Jump to content
xisto Community
Sign in to follow this  
magiccode91405241511

Small Issues About Mysql Connector/j 5.1

Recommended Posts

Hi, all,


I just downloaded some versions of mysql Connector/J mysql java driver
to test some stuffs.

There is an issue about the lastest version of 5.1.7.
It don't work correctly on older version of java 1.3.1.

But an older version 5.0.x works without any issue.
Hmm... anyone have ideas about this ?


Testing with 5.1.7

C:\org>java -Xverify:none programException in thread "main" java.lang.NoSuchMethodError		at com.mysql.jdbc.ConnectionPropertiesImpl$BooleanConnectionProperty.<init>(ConnectionPropertiesImpl.java:73)		at com.mysql.jdbc.ConnectionPropertiesImpl.<init>(ConnectionPropertiesImpl.java:686)		at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:628)		at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:298)		at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)		at java.sql.DriverManager.getConnection(Unknown Source)		at java.sql.DriverManager.getConnection(Unknown Source)		at program.main(program.java:17)

Source code for the test
import java.*;import java.sql.*;import java.util.Date;public class program{	public static void main(String[] args)	{		Connection conn = null;		Statement stmt = null;		ResultSet rs = null;		try		{			Class.forName("com.mysql.jdbc.Driver");			conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "user1", "");			conn.setAutoCommit(false);			stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);			rs = stmt.executeQuery("select * from sample");			rs.close();			stmt.close();		}		catch (Exception ex)		{			System.out.println(ex);		}	}}

Thanks,

---
Magiccode9
Edited by magiccode9 (see edit history)

Share this post


Link to post
Share on other sites

What problems (error codes est.) are you getting with the 5.1.7 version? Is there a chance that the older version 5.0.x has its required files in its library and the other version doesn't? Did you try just placing the required files in the same folder as your file for example folderA/myfile.java folderA/com/... or folderA/org/... est. There are multiple things that could be occurring and there is a possibility (though not too likely) that support for Connector/J skips a version of java or simply requires the latest version of java. In this case however you’re probably not the first one to notice this so there is probably a bug report if that is the issue. If this is the problem you may need to upgrade your java J2SE to the latest version. If you could provide a little more information people may be able to help out more.Hope this helps,Sparkx

Share this post


Link to post
Share on other sites

The issue with the connector/J 5.1.7 was the exception throw with [method not found].But the same .class file compiled with java 1.3.1 I run under an older version of connector that work without any problems.(both 5.0.x and 3.1)What I did was place and set the CLASSPATH to point to the jar file in the system applet.CLASSPATH=c:\java\lib\mysql-java.jarWill this be affected with a .class that is written with Generics ?Thanks,---Magiccode9,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.