aspose file tools*
The moose likes JBoss/WildFly and the fly likes Getting Exception in JDBC-Oracle java.sql.SQLException: ORA-00911: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Getting Exception in JDBC-Oracle java.sql.SQLException: ORA-00911:" Watch "Getting Exception in JDBC-Oracle java.sql.SQLException: ORA-00911:" New topic
Author

Getting Exception in JDBC-Oracle java.sql.SQLException: ORA-00911:

Sumit Tiwari
Greenhorn

Joined: Sep 26, 2011
Posts: 22


I am getting this exception
My Query is public static final String LOGINDETAILS ="INSERT INTO LOGIN VALUES(?,?);";
statement is

public int insertIntoDB(User user){
try{

con =DBConnector.getConnection();
query =MultipleQueries.LOGINDETAILS;
ps =con.prepareStatement(query);
ps.setString(1, user.getUserId());
ps.setString(2, user.getPassword());
insertSuccess=ps.executeUpdate();



}catch (Exception e) {
e.printStackTrace();
System.out.println("eeeeeeeeeeeeeeeeeeeeeeee");
}finally
{
try {
ps.close();
con.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
return insertSuccess;
}


Exception is:






14:06:00,004 ERROR [STDERR] java.sql.SQLException: ORA-00911: invalid character
14:06:00,004 ERROR [STDERR] at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
14:06:00,004 ERROR [STDERR] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)
14:06:00,004 ERROR [STDERR] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)
14:06:00,004 ERROR [STDERR] at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742)
14:06:00,005 ERROR [STDERR] at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:212)
14:06:00,005 ERROR [STDERR] at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:951)
14:06:00,005 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1159)
14:06:00,005 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)
14:06:00,005 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3367)
14:06:00,005 ERROR [STDERR] at com.tcs.demo.ds.UserDao.insertIntoDB(UserDao.java:42)
14:06:00,005 ERROR [STDERR] at com.tcs.demo.servlet.LoginServlet.Login.service(Login.java:39)
14:06:00,005 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
14:06:00,005 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
14:06:00,005 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
14:06:00,005 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
14:06:00,005 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
14:06:00,005 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
14:06:00,005 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
14:06:00,005 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
14:06:00,005 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
14:06:00,006 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
14:06:00,006 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
14:06:00,006 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
14:06:00,006 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
14:06:00,006 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
14:06:00,006 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
14:06:00,006 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
14:06:00,006 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
14:06:00,006 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
14:06:00,006 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
14:06:00,006 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
14:06:00,006 ERROR [STDERR] at java.lang.Thread.run(Unknown Source)
Ifteqar Ald
Ranch Hand

Joined: Dec 26, 2011
Posts: 73
Sumit Tiwari wrote:

I am getting this exception
My Query is public static final String LOGINDETAILS ="INSERT INTO LOGIN VALUES(?,?);";



Remove the extra Semicolon from your String
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Exception in JDBC-Oracle java.sql.SQLException: ORA-00911: