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

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem executing prepareStatement" Watch "Problem executing prepareStatement" New topic

Problem executing prepareStatement

Gopi Rajesh

Joined: Dec 09, 2003
Posts: 6
i tried to execute the code given below but seem to get the following error
java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.throwGenericSQLException(
at sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(
at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(
at sun.jdbc.odbc.JdbcOdbcConnection.prepareStatement(
at VM.NewVersionCreation.updateSysVersionsDB(
at VM.NewVersionCreation.createDraftVersion(
at VM.NewVersionCreation.main(

Where have i missed?
any solutions to this problem will be helpful
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
I didn't see anything wrong with either the SQL or the Java code, so I must assume that you are trying to do something that your database+driver combination doesn't allow.
What database are you using? Also, is there are type 4 JDBC driver available for this database?
Gopi Rajesh

Joined: Dec 09, 2003
Posts: 6
I found the mistake. My connection object was closed before executing this method. Thats why it shows an error. Thanks for ur effort
I agree. Here's the link:
subject: Problem executing prepareStatement
Similar Threads
JDBC Error with servlets - please help
Database connection
Need help
Connecting to DB Error
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] '(unknown)'