File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JDBC ODBC error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC ODBC error" Watch "JDBC ODBC error" New topic
Author

JDBC ODBC error

Manu Quartier
Greenhorn

Joined: Oct 20, 2000
Posts: 10
Hi,
I use Visual Age 3.0 and JDK 1.2.2. In VA, I have have no problem, but when I run my code with java.exe, I have an error:
The instruction at "0x...." referenced memory at "0x....". The memory could not be "read".
Can somebody help me?
Here is the code :
import java.sql.*;
public class DB {
public static void main(String args[]) {

String url = "jdbcdbc:Equadis";
Connection con;

String query = "select id_rayon, var_nom_rayon from rayon";

try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con = DriverManager.getConnection(url, "sa", "");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
stmt.close();
con.close();

System.out.println("gnagna test");
//the error appens here ->
while (rs.next()) {
System.out.println(rs.getString("id_rayon"));
}
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC ODBC error