File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes problem with insert query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "problem with insert query" Watch "problem with insert query" New topic

problem with insert query

vijayalakshmi raghavan

Joined: Mar 25, 2012
Posts: 5
I already went through similar topics in the forum. But none of the solutions are working.

I am doing a project using tomcat.

I have my MSAccess DB inside tomcat/webapps/MyFiles/db1.mdb
I have a class named"" inside tomcat/webapps/MyFiles/WEB-INF/classes

Th following is code.

When I compile and execute the program, i get the following error.

java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(Unknown Source)

at Jn.main(

I have created the DataSource under SystemDSN and not userDSN.

Please help!!!
Wendy Gibbons

Joined: Oct 21, 2008
Posts: 1107

does it work when you remove tomcat, and just run from the command line (or your IDE) as a standalone main program?
It is sorta covered in the JavaRanch Style Guide.
subject: problem with insert query
It's not a secret anymore!