yeah, I tried the new connector. but I'm getting strange results when using a date field,


My sql looks like..


Where R_Date < ? and R_Date > ? and H_ID <> ?........

My code looks like...

perparedStmt.setDate(1,new java.sql.Date(myDate.getTime()));

R_Date looks like...
R_Date date Not null

It doesn't crash, but it doesn't return the records either.When I use the stable connector/j it works fine (but of course, it's not really doing a prepared statement in the background)

Also just at the point where I execute the statement, I get strange text output to stdout, something like "0 0 0 0 0 8 0 0 0 ......."


It works when i don't use date fields.


Do you think this will be fixed in the next release release ?
Maybe I'm doing somthing wrong, who knows.






From: Mark Matthews <[EMAIL PROTECTED]>
To: Brian Power <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: anybody used prepared statements in 4.1 succesfully?
Date: Thu, 22 Jan 2004 09:49:35 -0600

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian Power wrote:

> anybody used prepared statements in 4.1 succesfully?
>
>
> Has anybody used prepared statements in mySQL 4.1 succesfully. By
> succesfull I mean quicker !
>
> I have some prepared statement in my app and they take just as long the
> second++ time as they do hte first. My querys may need to be optimized
> (i just moved over from Access), but even so, shouldn't they be quicker
> the second time around.
>
>
> Im using java and Connector/J 3.0

You need to use Connector/J _3.1_ to get server-side prepared statement
functionality.

I suggest using the nightly snapshots until 3.1.1 is released (which
should be later this week). 3.1.1 (as well as the latest nightly
snapshots) also includes support for CallableStatements when using
MySQL-5.0.0 and newer.

See http://downloads.mysql.com/snapshots.php

Regards,

-Mark

- --
Mr. Mark Matthews
MySQL AB, Software Development Manager, J2EE and Windows Platforms
Office: +1 708 557 2388
www.mysql.com

Want to swim with the dolphins? (April 14-16, 2004)
  http://www.mysql.com/uc2004/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAD/EPtvXNTca6JD8RApjrAJoCfb9DlLrtWAXH8XQIBEtwcZQNWQCgw9WS
i+NBEfX6gTUHyGZ+K7LkVtc=
=heEx
-----END PGP SIGNATURE-----

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to