Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Another 'java.sql.SQLException: General error' RELATED PROBLEM !!!

843859Apr 23 2006 — edited Apr 23 2006
Hi all, first time poster ...............

Here is a snippet of the method i am uisng thats gen' this exception.

public void insertSQL()
{
String dataSourceName = "ccfDSN";
String dbURL = "jdbc:odbc:" + dataSourceName;

try
{
System.out.println("Loading JdbcOdbcDriver ....");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e)
{
System.out.println("Driver ERROR!!!!" + e);
}

try
{
Connection con = DriverManager.getConnection(dbURL, "","");
System.out.println("Connect to " + con.getCatalog() + " a success!");

Statement stat = con.createStatement();
System.out.println(query);

stat.executeUpdate(query);

stat.close();
con.close();
}
catch (SQLException e)
{
JOptionPane.showMessageDialog(p,
"INSERT Error !!!\n"
+"Make Sure Each Typed Entry is Suitable for this Query.\n"
+"Error: !!! " + e.getMessage(),
"Error Message",
JOptionPane.ERROR_MESSAGE);

e.printStackTrace();
}
}

I am use this method many times and just this one time its giving this same general exception error. REPEATEDLY .......................... This method is being used to insert data into table that is not used by anything else apart from this one instance.

I have noticed that by not running the whole entire app' and just running my JDBC class on its own with a simple insert statement i get the same error.
I copy the problem related statement and running it directly on my JDBC class and i generate the same exception.

This leads me to believe that my prob' is directly related to my JDBC class and in my insertSQL() method.

Some1 please help !!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2006
Added on Apr 23 2006
4 comments
251 views