java.lang.NoClassDefFoundError: java.sql.Connection
Posted by: Jorge Lebrato
Date: October 07, 2008 06:21AM

I'm tryng yo use the mysql-connector-java-5.0.8 to access a database from an application that i'm doing with jme
I don't know why i hace this error when i try execute my program
This is my code

import java.sql.*;

......
......

try {
Class.forName("org.gjt.mm.mysql.Driver");
} catch (Exception e) {
e.printStackTrace();
}

try {
Connection conexion = DriverManager.getConnection("jdbc:mysql://host", "user", "password");
Statement s = conexion.createStatement();
//ResultSet rs = s.executeQuery ("select * from table");
//while (rs.next()) {
// System.out.println (rs.getString (1) + " " + rs.getString (2)+ " " + rs.getString(3));
//}
//conexion.close();
} catch (Exception e) {
e.printStackTrace();
}

If i execute this in my pc, it works (in NetBeans) but, when i try it in my device, i have this problem

any idea?

Options: ReplyQuote


Subject
Written By
Posted
java.lang.NoClassDefFoundError: java.sql.Connection
October 07, 2008 06:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.