I am getting following exception.
I could able to connect using sqlplus and tnslistener is working
properly
can anybody please tell me what the problem is
java.sql.SQLException: Protocol violation
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:803)
at oracle.jdbc.ttc7.O3log.receive2nd(O3log.java:520)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:230)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198) at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at Temp.main(Temp.java:7)
sincere thanks
prudhvi
1) try DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); instead of the Class.forName()
I've seen exceptions thrown when using Class.forName notation in a signed applet.
I've recently seen exceptions thrown when using Class.forName notation in a servlet that was connecting
to a 9i database...sigh
Flipped it to using the DriverManager.registerDriver notation and the db was happy.
2) verify that tcp/ip is on the database server machine.
3) Is line 7 of your code Connection con = ...?
4) verify that the database is listening on port 1521...look in the listerner.ora file.
hth,
cindy