unicode charset support ?

2001-11-29 Thread yilmaz

hi mysql guru's,
does anyone put light on the unicode charset support of MYSQL?
i searced everywhere in  the archives and the docs , but couldn't find
a related thing.It seems that it doesn't support, however i am 
asking you  to be sure.
My application needs to save both japanese and chinese charsets,
thus i must use unicode to support both of those charsets.
So far i was using mysql jsut for big5(traditional chinese ) charset,
it was working okey.When i try to save japanese characters i am having
trouble, the characters become garbled.???
Any one who knows the  solution for this.
thanks for helping me.
(note: my mysql version is 3.23, os is win2000)



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Too many connections (again) (could Mark answer this please)

2001-11-27 Thread yilmaz

thanks a lot Mark,
now i figured it out, i should have used finally {} statements around
close() functions.
Best regards :)
- Original Message -
From: Mark Matthews [EMAIL PROTECTED]
To: yilmaz [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, November 27, 2001 10:07 PM
Subject: Re: Too many connections (again) (could Mark answer this please)


 I've answered this twice, both in personal e-mails, but I'll answer it
 again, one last time :).



 Three things, First, you're using an old version of the driver. Please
 upgrade to the latest (you should do this when you suspect it might be the
 driver. Always check http://mmmysql.sourceforge.net/ as this is
 _the_only_official_ MM.MySQL download site. I can't vouch for anything you
 download from somewhere else).



 Second, you are not closing your connections in finally{} blocks, so you
can
 not guarantee that they are being closed! Many browsers terminate the
 connection to the servlet/JSP early (IE for example), which can cause code
 you think should be executing not to execute. You should _always_ get rid
of
 expensive resources in a finally{} block to make sure that it actually
 happens.



 Third, please subscribe to the [EMAIL PROTECTED] This forum is not the
 correct place to ask these types of questions, and I only get it in digest
 mode, so it takes me a while to read/get back to people who ask JDBC
 questions in the mysql list.



 -Mark



 - Original Message -

 Message-ID: 000701c17707$7d6a7610$7300a8c0@yilmaz

 From: yilmaz [EMAIL PROTECTED]

 To: [EMAIL PROTECTED]

 Subject: Re: Too many connections (again) (could Mark answer this please)

 Date: Tue, 27 Nov 2001 13:50:59 +0800

 MIME-Version: 1.0

 Content-Type: text/plain;

 charset=iso-8859-1

 Content-Transfer-Encoding: 7bit

 Me , too, have the same problem.

 it seems that every opened page establishes a connection but

 those connections can't be closed, although i explicitly close in my code

 I posted a message related with this problem a few days ago,

 unfortunately couldn't get a satisfying answer. So, i request from Mark

 Matthew

 to help us with this problem , since he is the author of Mysql.

 (my Mysql version is 3.23 , i use jdbc through tomcat 4 b7, on win 2000.)

 Thanks in advance

 cheers





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Getting to latest 5 Records

2001-11-26 Thread yilmaz

just to make it clearer:

select * from your_table order by auto_increment_column desc limit 5
cheers :)
- Original Message -
From: Luis Ferro [EMAIL PROTECTED]
To: 'Jack' [EMAIL PROTECTED]; 'Mysql List' [EMAIL PROTECTED]
Sent: Monday, November 26, 2001 6:30 PM
Subject: RE: Getting to latest 5 Records


 The best way is to get the records ordered inverselly by the
auto-increment
 field and then restrict the return to 5 records.

 Cheers,
 Luis Ferro
 WebDev

 -Original Message-
 From: Jack [mailto:[EMAIL PROTECTED]]
 Sent: segunda-feira, 26 de Novembro de 2001 10:02
 To: Mysql List
 Subject: Getting to latest 5 Records


 Dear all
 I had a table which with Auto_increment, which means when i insert a
record
 there will be a number insert to lead as the location of the record.
 here is my question.
 I was try to get the most last five records , but i don't know which query
 should i use?

 Thx
 Jack


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Arrayoutofindexexception

2001-11-26 Thread yilmaz

I already checked java api docs, but it doesn't provide any information  nor
any help.
Since usually error messages and docs doesn't give a user friendly and
helpful
info, i hope somebody who already faced the same problem could give me some
hints about what
could be the reason.
thanks for taking time
cheers :)

 Original Message -
From: Joseph Roth [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 26, 2001 9:41 PM
Subject: Re: Arrayoutofindexexception


 At 04:01 PM 11/26/2001 +0800, yilmaz wrote:
 hi all,
 first of all, since this is a jdbc specific question, you might say i
should
 post to java mysql
 mailing list, but for some reasons my java mysql subscribtion seems
didn't
 succeed although
 i got a confirmation and a welcome email. (of course i confirmed my
 subscribtion)
 Anyway my request is:
 can someone tell me please what does ArrayIndexOutOfBoundsException
 exacly mean? and how can it be solved?
 i couldn't figure out where the problem is  altough  i spent  almost half
 working day.
 below is the error message :
 
 java.lang.ArrayIndexOutOfBoundsException
  at
  org.gjt.mm.mysql.PreparedStatement.set(PreparedStatement.java:1192)
  at
  org.gjt.mm.mysql.PreparedStatement.setString(PreparedStatement.java:581)
  at

org.apache.jsp._0002fay_0002fmember_jsp._jspService(_0002fay_0002fmember_js
p
 .java:178)
 .
 i have exactly same number of column names as variables in
preparedstatemnet
 and same number of ? marks.
 i am using mySQL version 3.23  with tomcat 4.0 b7 under win 2000.
 Can anyone help me please?
 thanks in advance
 wish everybody a day without troubles :)

 Check out:

http://java.sun.com/products/jdk/1.2/docs/api/java/lang/ArrayIndexOutOfBound
sException.html

 I got this from a quick search on Google of
ArrayIndexOutOfBoundsException

 HTH



 Joseph Roth
 [EMAIL PROTECTED]


 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Too many connections (again) (could Mark answer this please)

2001-11-26 Thread yilmaz

Me , too, have the same problem.
it seems that every opened page establishes a connection but
those connections can't be closed, although i explicitly close in my code
I posted a message related with this problem a few days ago,
unfortunately couldn't get a satisfying  answer. So, i request from Mark
Matthew
to help us with this problem , since he is the author of Mysql.
(my Mysql version is 3.23 , i use jdbc through tomcat 4 b7, on win 2000.)
Thanks in advance
cheers
- Original Message -
From: sherzodR [EMAIL PROTECTED]
To: Chris Mason [EMAIL PROTECTED]
Cc: MySQL List [EMAIL PROTECTED]
Sent: Tuesday, November 27, 2001 1:19 PM
Subject: Re: Too many connections (again)




 I keep getting that error too. But I couldn't figure out the cause. So I
 just used Apache::DBI for persistent DB connection ( you can't do that
 unless your scripts are running under mod_perl )

 --
 sherzodR


 On Mon, 26 Nov 2001, Chris Mason wrote:

 I have a lot of databased websites running on my server (1 Ghz P3/256
 MB/20GB/RH7.1) and I am continually getting connection problems. None of
the
 sites are high volume, so I am surprised by this and I suspect that
 connections are not being reused quickly enough.
 
 Here's my config, can anyone help me sort this out?
 
 
 
 [root@server1 /root]# vi /etc/my.cnf
 
 [mysqld]
 #datadir=/var/lib/mysql
 datadir=/usr/mysql
 #socket=/usr/mysql/mysql.sock
 socket=/var/lib/mysql/mysql.sock
 
 [mysql.server]
 user=mysql
 basedir=/var/lib
 max_connections=300
 
 [safe_mysqld]
 err-log=/var/log/mysqld.log
 pid-file=/var/run/mysqld/mysqld.pid
 
 
 Chris Mason
 [EMAIL PROTECTED]
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: number of connections keeps increasing

2001-11-25 Thread yilmaz
Hi takashi,
My environment is :
Win2000, jdk1.3,  tomcat 4,
Well, i am sure i added a snippet which closes statemnt and the connection.
for example, below is the snippet from one of my pages content.jsp :

% if (stmt!=null) { // actually this is a curly left brace
  stmt.close(); }  // actually this is a curly right brace
  if (conn!=null){ // stmt is a Statement object
  conn.close();  //  conn is a Connection object
  } %

whenever i call this page , number of connections inreases by one
it seems that the connections can not be closed
Any idea or suggestions ?
thanks a lot in advance
best regards :)

- Original Message -
From: "TAKAHASHI, Tomohiro" [EMAIL PROTECTED]
To: "yilmaz" [EMAIL PROTECTED]
Sent: Sunday, November 25, 2001 8:02 PM
Subject: Re: number of connections keeps increasing

   I want to know environment about Java, JDBC, Servlet-Conatiner, and so
on.
   Maybe, I think you forget to close connection in JSP somewhere.

 yilmaz wrote:
 
  hi takashi,
  i don't know which jsp page exactly causes this problem,
  because i have more than 30 JSP pages in my application, and i always
  close my statements and connections after the process is finished.
  But , i think probably the problem comes from MySQL itself
  below is my MySQL environment:
 
  This Report was made using the WinMySQLadmin 1.0 Tool
 
 snip

 --
 TAKAHASHI, Tomohiro




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


Arrayoutofindexexception

2001-11-25 Thread yilmaz

hi all,
first of all, since this is a jdbc specific question, you might say i should
post to java mysql
mailing list, but for some reasons my java mysql subscribtion seems didn't
succeed although
i got a confirmation and a welcome email. (of course i confirmed my
subscribtion)
Anyway my request is:
can someone tell me please what does ArrayIndexOutOfBoundsException
exacly mean? and how can it be solved?
i couldn't figure out where the problem is  altough  i spent  almost half
working day.
below is the error message :

java.lang.ArrayIndexOutOfBoundsException
at org.gjt.mm.mysql.PreparedStatement.set(PreparedStatement.java:1192)
at org.gjt.mm.mysql.PreparedStatement.setString(PreparedStatement.java:581)
at
org.apache.jsp._0002fay_0002fmember_jsp._jspService(_0002fay_0002fmember_jsp
.java:178)
.
i have exactly same number of column names as variables in preparedstatemnet
and same number of ? marks.
i am using mySQL version 3.23  with tomcat 4.0 b7 under win 2000.
Can anyone help me please?
thanks in advance
wish everybody a day without troubles :)



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




why doesn't prepared statement work?

2001-11-20 Thread yilmaz

Hi all,
i have a strange situation here,
i am trying to execute an sql insert via prepared statements.
though it is a simple insert process, i am having a syntax error message.
Doesn't mysql support this?
can someone please tell me what is wrong with this query?

String query=insert into temp(member ,ename,cname,jname ,sex ,age ,+
 nation ,prf ,occ  ,educ ,address ,city ,res_city,res_address ,+
 htel ,mtel,otel ,fax ,email) +
 values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);
PreparedStatement stmt=conn.prepareStatement(query);

stmt.setString(1,member);
stmt.setString(2,ename);
stmt.setString(3,cname);
stmt.setString(4,jname);
stmt.setString(5,sex);
stmt.setInt(6,age);
stmt.setString(7,nation);
stmt.setString(8,prf);
stmt.setString(9,occ);
stmt.setString(10,educ);
stmt.setString(11,address);
stmt.setString(12,city);
stmt.setString(13,res_city);
stmt.setString(14,res_address);
stmt.setString(15,htel);
stmt.setString(16,mtel);
stmt.setString(17,otel);
stmt.setString(18,fax);
stmt.setString(19,email);
   stmt.executeUpdate(query);

  stmt.close();
  conn.close();

the error message says:
javax.servlet.ServletException: Syntax error or access violation: You have
an error in your SQL syntax near '?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)' at
line 1


thanks a lot in advance :)



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




why doesn't prepared statement work?

2001-11-20 Thread yilmaz

Hi all,
i have a strange situation here,
i am trying to execute an sql insert via prepared statements.
though it is a simple insert process, i am having a syntax error message.
Doesn't mysql support this?
can someone please tell me what is wrong with this query?

String query=insert into temp(member ,ename,cname,jname ,sex ,age ,+
 nation ,prf ,occ  ,educ ,address ,city ,res_city,res_address ,+
 htel ,mtel,otel ,fax ,email) +
 values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);
PreparedStatement stmt=conn.prepareStatement(query);

stmt.setString(1,member);
stmt.setString(2,ename);
stmt.setString(3,cname);
stmt.setString(4,jname);
stmt.setString(5,sex);
stmt.setInt(6,age);
stmt.setString(7,nation);
stmt.setString(8,prf);
stmt.setString(9,occ);
stmt.setString(10,educ);
stmt.setString(11,address);
stmt.setString(12,city);
stmt.setString(13,res_city);
stmt.setString(14,res_address);
stmt.setString(15,htel);
stmt.setString(16,mtel);
stmt.setString(17,otel);
stmt.setString(18,fax);
stmt.setString(19,email);
   stmt.executeUpdate(query);

  stmt.close();
  conn.close();

the error message says:
javax.servlet.ServletException: Syntax error or access violation: You have
an error in your SQL syntax near '?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)' at
line 1


thanks a lot in advance :)



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: why doesn't prepared statement work?

2001-11-20 Thread yilmaz

Thanks Hans,
when i replcaed  ? with ? , this time i ma having

java.lang.ArrayIndexOutOfBoundsException
at org.gjt.mm.mysql.PreparedStatement.set(PreparedStatement.java:1192)
at
org.gjt.mm.mysql.PreparedStatement.setString(PreparedStatement.java:581)

error message.
However, i am sure there are exactly 19 fieldnames  and 19 ?s, also in the
database there
are 19 columns exactly matching the filednames.
what could be wrong now?


- Original Message -
From: Hans [EMAIL PROTECTED]
To: yilmaz [EMAIL PROTECTED]
Sent: Wednesday, November 21, 2001 8:48 AM
Subject: Re: why doesn't prepared statement work?


 maybe u should use '?' instead of ?.
 Btw, isn't that special char which need function htmlspecialchars() ?

 - Original Message -
 From: yilmaz [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, November 20, 2001 1:11 AM
 Subject: why doesn't prepared statement work?


  Hi all,
  i have a strange situation here,
  i am trying to execute an sql insert via prepared statements.
  though it is a simple insert process, i am having a syntax error
message.
  Doesn't mysql support this?
  can someone please tell me what is wrong with this query?
 
  String query=insert into temp(member ,ename,cname,jname ,sex ,age ,+
   nation ,prf ,occ  ,educ ,address ,city ,res_city,res_address ,+
   htel ,mtel,otel ,fax ,email) +
   values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);
  PreparedStatement stmt=conn.prepareStatement(query);
 
  stmt.setString(1,member);
  stmt.setString(2,ename);
  stmt.setString(3,cname);
  stmt.setString(4,jname);
  stmt.setString(5,sex);
  stmt.setInt(6,age);
  stmt.setString(7,nation);
  stmt.setString(8,prf);
  stmt.setString(9,occ);
  stmt.setString(10,educ);
  stmt.setString(11,address);
  stmt.setString(12,city);
  stmt.setString(13,res_city);
  stmt.setString(14,res_address);
  stmt.setString(15,htel);
  stmt.setString(16,mtel);
  stmt.setString(17,otel);
  stmt.setString(18,fax);
  stmt.setString(19,email);
 stmt.executeUpdate(query);
 
stmt.close();
conn.close();
 
  the error message says:
  javax.servlet.ServletException: Syntax error or access violation: You
have
  an error in your SQL syntax near
'?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'
 at
  line 1
 
 
  thanks a lot in advance :)
 
 
 
  -
  Before posting, please check:
 http://www.mysql.com/manual.php   (the manual)
 http://lists.mysql.com/   (the list archive)
 
  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail
 [EMAIL PROTECTED]
  Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 
 





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: why doesn't prepared statement work?

2001-11-20 Thread yilmaz

Thanks Neil,
even with only one parameter it doesn't work.
it keeps throwing:

javax.servlet.ServletException: Syntax error or access violation: You have
an error in your SQL syntax near '?)' at line 1

when i replace ? with '?'  it throws:
java.lang.ArrayIndexOutOfBoundsException
at org.gjt.mm.mysql.PreparedStatement.set(PreparedStatement.java:1192)
at
org.gjt.mm.mysql.PreparedStatement.setString(PreparedStatement.java:581)

It is very strange , isn't it?

- Original Message -
From: DL Neil [EMAIL PROTECTED]
To: yilmaz [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, November 20, 2001 7:29 PM
Subject: Re: why doesn't prepared statement work?


 Yilmaz,
 Recommend you simplify. Test on (say) the first five fields, then the next
five,... and try to work out which
 field is causing the issue, then analyse by narrowing down until you
figure it out.
 The data value (in the (?,?,?,...) list, must be formatted to suit the
type in the column list.
 Regards,
 =dn

 - Original Message -
 From: yilmaz [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: 20 November 2001 10:18
 Subject: Re: why doesn't prepared statement work?


  Thanks Hans,
  when i replcaed  ? with ? , this time i ma having
 
  java.lang.ArrayIndexOutOfBoundsException
  at org.gjt.mm.mysql.PreparedStatement.set(PreparedStatement.java:1192)
  at
  org.gjt.mm.mysql.PreparedStatement.setString(PreparedStatement.java:581)
 
  error message.
  However, i am sure there are exactly 19 fieldnames  and 19 ?s, also in
the
  database there
  are 19 columns exactly matching the filednames.
  what could be wrong now?
 
 
  - Original Message -
  From: Hans [EMAIL PROTECTED]
  To: yilmaz [EMAIL PROTECTED]
  Sent: Wednesday, November 21, 2001 8:48 AM
  Subject: Re: why doesn't prepared statement work?
 
 
   maybe u should use '?' instead of ?.
   Btw, isn't that special char which need function htmlspecialchars() ?
  
   - Original Message -
   From: yilmaz [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Tuesday, November 20, 2001 1:11 AM
   Subject: why doesn't prepared statement work?
  
  
Hi all,
i have a strange situation here,
i am trying to execute an sql insert via prepared statements.
though it is a simple insert process, i am having a syntax error
  message.
Doesn't mysql support this?
can someone please tell me what is wrong with this query?
   
String query=insert into temp(member ,ename,cname,jname ,sex ,age
,+
 nation ,prf ,occ  ,educ ,address ,city ,res_city,res_address
,+
 htel ,mtel,otel ,fax ,email) +
 values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);
PreparedStatement stmt=conn.prepareStatement(query);
   
stmt.setString(1,member);
stmt.setString(2,ename);
stmt.setString(3,cname);
stmt.setString(4,jname);
stmt.setString(5,sex);
stmt.setInt(6,age);
stmt.setString(7,nation);
stmt.setString(8,prf);
stmt.setString(9,occ);
stmt.setString(10,educ);
stmt.setString(11,address);
stmt.setString(12,city);
stmt.setString(13,res_city);
stmt.setString(14,res_address);
stmt.setString(15,htel);
stmt.setString(16,mtel);
stmt.setString(17,otel);
stmt.setString(18,fax);
stmt.setString(19,email);
   stmt.executeUpdate(query);
   
  stmt.close();
  conn.close();
   
the error message says:
javax.servlet.ServletException: Syntax error or access violation:
You
  have
an error in your SQL syntax near
  '?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'
   at
line 1
   
   
thanks a lot in advance :)
   
   
   
  
 -
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)
   
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
   [EMAIL PROTECTED]
Trouble unsubscribing? Try:
http://lists.mysql.com/php/unsubscribe.php
   
   
   
  
  
 
 
 
  -
  Before posting, please check:
 http://www.mysql.com/manual.php   (the manual)
 http://lists.mysql.com/   (the list archive)
 
  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail
[EMAIL PROTECTED]
  Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check

Re: why doesn't prepared statement work?

2001-11-20 Thread yilmaz

Well,
i am answering  my own question.
It was keeping  telling me that there is a syntax error.
However, the real problem was at the bottom the preparedstatement code
snippet
stmt.executeUpdate(query);
statement should have been
stmt.executeUpdate(); (without parameter)
Wouldn't it make our lives easier if MySQL had thrown a sensible
and a logical error message so that developers need not to
waste a lot of time on a fairly small problem?

- Original Message -
From: yilmaz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 20, 2001 9:08 PM
Subject: Re: why doesn't prepared statement work?


 Thanks Neil,
 even with only one parameter it doesn't work.
 it keeps throwing:

 javax.servlet.ServletException: Syntax error or access violation: You have
 an error in your SQL syntax near '?)' at line 1

 when i replace ? with '?'  it throws:
 java.lang.ArrayIndexOutOfBoundsException
 at org.gjt.mm.mysql.PreparedStatement.set(PreparedStatement.java:1192)
 at
 org.gjt.mm.mysql.PreparedStatement.setString(PreparedStatement.java:581)

 It is very strange , isn't it?

 - Original Message -
 From: DL Neil [EMAIL PROTECTED]
 To: yilmaz [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, November 20, 2001 7:29 PM
 Subject: Re: why doesn't prepared statement work?


  Yilmaz,
  Recommend you simplify. Test on (say) the first five fields, then the
next
 five,... and try to work out which
  field is causing the issue, then analyse by narrowing down until you
 figure it out.
  The data value (in the (?,?,?,...) list, must be formatted to suit the
 type in the column list.
  Regards,
  =dn
 
  - Original Message -
  From: yilmaz [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: 20 November 2001 10:18
  Subject: Re: why doesn't prepared statement work?
 
 
   Thanks Hans,
   when i replcaed  ? with ? , this time i ma having
  
   java.lang.ArrayIndexOutOfBoundsException
   at org.gjt.mm.mysql.PreparedStatement.set(PreparedStatement.java:1192)
   at
  
org.gjt.mm.mysql.PreparedStatement.setString(PreparedStatement.java:581)
  
   error message.
   However, i am sure there are exactly 19 fieldnames  and 19 ?s, also
in
 the
   database there
   are 19 columns exactly matching the filednames.
   what could be wrong now?
  
  
   - Original Message -
   From: Hans [EMAIL PROTECTED]
   To: yilmaz [EMAIL PROTECTED]
   Sent: Wednesday, November 21, 2001 8:48 AM
   Subject: Re: why doesn't prepared statement work?
  
  
maybe u should use '?' instead of ?.
Btw, isn't that special char which need function htmlspecialchars()
?
   
- Original Message -
From: yilmaz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 20, 2001 1:11 AM
Subject: why doesn't prepared statement work?
   
   
 Hi all,
 i have a strange situation here,
 i am trying to execute an sql insert via prepared statements.
 though it is a simple insert process, i am having a syntax error
   message.
 Doesn't mysql support this?
 can someone please tell me what is wrong with this query?

 String query=insert into temp(member ,ename,cname,jname ,sex ,age
 ,+
  nation ,prf ,occ  ,educ ,address ,city ,res_city,res_address
 ,+
  htel ,mtel,otel ,fax ,email) +
  values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);
 PreparedStatement stmt=conn.prepareStatement(query);

 stmt.setString(1,member);
 stmt.setString(2,ename);
 stmt.setString(3,cname);
 stmt.setString(4,jname);
 stmt.setString(5,sex);
 stmt.setInt(6,age);
 stmt.setString(7,nation);
 stmt.setString(8,prf);
 stmt.setString(9,occ);
 stmt.setString(10,educ);
 stmt.setString(11,address);
 stmt.setString(12,city);
 stmt.setString(13,res_city);
 stmt.setString(14,res_address);
 stmt.setString(15,htel);
 stmt.setString(16,mtel);
 stmt.setString(17,otel);
 stmt.setString(18,fax);
 stmt.setString(19,email);
stmt.executeUpdate(query);

   stmt.close();
   conn.close();

 the error message says:
 javax.servlet.ServletException: Syntax error or access violation:
 You
   have
 an error in your SQL syntax near
   '?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'
at
 line 1


 thanks a lot in advance :)



   
  -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try:
 http://lists.mysql.com/php/unsubscribe.php



   
   
  
  
  
   -
   Before posting, please check:
  http

nested select queries

2001-11-18 Thread yilmaz

hi everybody,
i have a simple problem, but somehow i couldn't solve it
i hope someone overthere can help me.
i have a select query as below:
select no,subject,ndate from cat1 where news like '%+search+%' limit
+page_no+,5
i also want to find out how many rows are there in the result set.
what is the easiest way to do this?
actually , i wonder if there is a facility such as:
select count(*) from (select no,sub.)
but this doesn't work.
is there a similar way?
the only way i could think of is creating a table with the first select
query
and then counting it eg:
query1=create table temp as select 'query1'
select count(*) from the_table_resulted_from_query1
but this seems too inefficient and stupid way.
any one has a better idea?
thanks a lot?



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




how to auto_decrement a primary key?

2001-11-12 Thread yilmaz

Hi all,
i want to keep the track of row numbers to display the results , say, five
by five.
the most common way to do this is defining a column which is
auto_incrementing and not null.
but htere is a problem with this approach.
say, i have a table which stores the subject and contents of articles, and
it has a primary key, say pk.
since pk is auto incrementing , whenever a new article is added it will
increment by one.However, if
i delete an article ( a row) it will not decrement. So when i want to
display them five by five, i will
have trouble, because some numbers do not exist. In oracle there is an
imbedded variable called rownum,
so that you can workaround this. Is there a similar varible or a kind of
solution for this problem?
i am looking forward to your help, and suggestions.
many thanks in advance
cheers :)



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php