Nov 22, 2009

Small Issues About Mysql Connector/j 5.1

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Programming General > Java

Small Issues About Mysql Connector/j 5.1

magiccode9
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
CODE
C:\org>java -Xverify:none program

Exception in thread "main" java.lang.NoSuchMethodError
        at com.mysql.jdbc.ConnectionPropertiesImpl$BooleanConnectionProperty.<init>(ConnectionProper
tiesImpl.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
CODE
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

 

 

 


Comment/Reply (w/o sign-up)

sparkx
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

Comment/Reply (w/o sign-up)

magiccode9
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.jar

Will this be affected with a .class that is written with Generics ?


Thanks,

---
Magiccode9,

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)


See Also,

*SIMILAR VIDEOS*
Searching Video's for small, issues, mysql, connector, j, 5, 1
advertisement



Small Issues About Mysql Connector/j 5.1

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com