I am just trying to learn the Java.sql class as well as odbcs, the following is my code, I have everything spelled correctly and all the cases match up, I will post my code below and the printStackTrace from the error as well
package quote;
import java.sql.*;
/**
*
* @author tech
*/
public class Connect {
public static void main(
String[] args)
{
try {
String dataSourceName = "mdbTEST";
String dbURL = "jdbc:odbc:" + dataSourceName;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection(dbURL, "","");
Statement s = con.createStatement();
s.execute("INSERT INTO TEST12345 VALUES('1','2')"); // Line 25
s.close(); // close the Statement to let the database know we're done with it
con.close();
}
catch (Exception e) {
System.out.println("Error: " + e);
e.printStackTrace();
}
}
/** Creates a new instance of Connect */
public Connect() {
}
}
error is the following:
java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6987)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3111)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338)
at quote.Connect.main(Connect.java:25)\\where my error is
Any help would be greatly appreciated, I am using DSNs.