MySQL JDBC + prepared statements -> plain SQL in log

"Ondra Zizka" <[email protected]> Fri, 25 Jan 2008 18:27:07 +0100
Newsgroups gmane.comp.db.mysql.java
Message-ID <[email protected]>
Hello,

I'm sending some prepared statements to MySQL 5.0 using JDBC Driver 
Connector/J 5.x :

ps = conn.prepareStatement("INSERT INTO table SET txt = ?");
...

But according to the log, Connector converts them to plain text SQL 
statements --- 
      143 Query       INSERT INTO table SET txt = 'aXa6'
      143 Query       INSERT INTO table SET txt = 'aXa7'
      143 Query       INSERT INTO table SET txt = 'aXa8
...
---  although MySQL is capable of prepared statements  - according to the 
docs, JDBC can do them to:

MySQL 5.0 provides support for server-side prepared statements. This support
takes advantage of the efficient client/server binary protocol implemented
in MySQL 4.1, provided that you use an appropriate client programming
interface. Candidate interfaces include the MySQL C API client library (for
C programs), MySQL Connector/J (for Java programs), and MySQL Connector/NET.

Do I have to turn something on for the JDBC connection or where is the 
problem?
Or, does MySQL log the statements with the values inserted to the prepared 
statement?

Thanks, Ondra




-- 
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:    http://lists.mysql.com/[email protected]