| Author |
error while creating a statement
|
Rkrishna daruri
Greenhorn
Joined: Jun 05, 2002
Posts: 4
|
|
The code which helps in creating a statement is giving this error. java.sql.SQLException: General error at sun.jdbc.odbc.JdbcOdbc.throwGenericSQLException(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.SQLAllocStmt(Unknown Source) at sun.jdbc.odbc.JdbcOdbcConnection.createStatement(Unknown Source) ********* Can someone help me out in understanding why this is happening and what may be the solution. Thanks in Advance..Ramakrishna
|
 |
Rahul Mahindrakar
Ranch Hand
Joined: Jul 28, 2000
Posts: 1831
|
|
Hi dvrk, Your user name is invalid as per Javaranch Naming conventions document located here www.javaranch.com/name.jsp. Please re-register with a valid user name. With regard to your question please insert the code so that we can see what is wrong.
|
 |
Simon Brown
sharp shooter, and author
Ranch Hand
Joined: May 10, 2000
Posts: 1860
|
|
Moving this to the JDBC forum... Simon p.s. thanks Rahul
|
 |
Rkrishna daruri
Greenhorn
Joined: Jun 05, 2002
Posts: 4
|
|
The code which produces the error is as follows: 'con' is a connection initiated in the constructor of the class as follows: //**** Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc dbc:ETS","ETS","ETS"); //**** public ResultSet getModules(String PID,String MID) { try{ //ERROR OCCURS HERE stmtmodule = con.createStatement(); // sql = "select modulename from ETS_modules where projectID = '"+ PID +"' and moduleid = '" + MID + "'"; rsmodules = stmtmodule.executeQuery(sql); }catch(Exception e){ e.printStackTrace(); System.out.println("In module name " + e.getMessage());} return rsmodules; }
|
 |
 |
|
|
subject: error while creating a statement
|
|
|