aspose file tools*
The moose likes JDBC and the fly likes java.sql.SQLException: ORA-03115: unsupported network datatype or representation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: ORA-03115: unsupported network datatype or representation" Watch "java.sql.SQLException: ORA-03115: unsupported network datatype or representation" New topic
Author

java.sql.SQLException: ORA-03115: unsupported network datatype or representation

sirisha alam
Greenhorn

Joined: Dec 17, 2002
Posts: 13
Hi,

I trying to retrieve the results from a cursor in java and am getting the following error.

java.sql.SQLException: ORA-03115: unsupported network datatype or representation

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.v8Odscrarr.receive(v8Odscrarr.java:191)
at oracle.jdbc.ttc7.TTC7Protocol.describe(TTC7Protocol.java:586)
at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:484)
at oracle.jdbc.driver.OracleStatement.getCursorValue(OracleStatement.java:2661)
at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:4189)
at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:4123)
at oracle.jdbc.driver.OracleCallableStatement.getObject(OracleCallableStatement.java:541)
at server.SessionManager.createSession(SessionManager.java:57)
at server.MMServer.doPost(MMServer.java:74)
at server.MMServer.doGet(MMServer.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)


Here's the snippet of my java code:

cstmt = sqlUtil.createCallableStatement(query.toString());

cstmt.setString(1, userId);
cstmt.registerOutParameter(2, OracleTypes.CURSOR);
cstmt.execute();
rs = (ResultSet) cstmt.getObject(2); // error is pointing to this statement.

And i am using Oracle thin driver.

Your help is highly appreciated.

Thanks,
Sirisha
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

just for my clarification ! are you sure that you are using thin driver, can you put your connection string ?

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
sirisha alam
Greenhorn

Joined: Dec 17, 2002
Posts: 13
Here's my connection string

dbURL = "jdbc racle:thin:";
dbURL = dbURL + dbUser + "/" + dbPasswd + "@" + dbMachine + ":";
dbURL = dbURL + dbPort + ":" + dbServer;
con = DriverManager.getConnection (dbURL);

And i forgot to mention in my original posting that i am using Oracle 10G Database.

Sirisha
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

are you using classes12.zip to connect with oracle ?

Shailesh
sirisha alam
Greenhorn

Joined: Dec 17, 2002
Posts: 13
I tried with classes12.jar as well as ojdbc14.jar which was listed as thin driver (classes for use with jdk1.4) at http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html

Both the jars are returning the same error.

Sirisha
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

oracle 10 requires ojdbc14.jar to connect, i am assuming that you are also registering or loading driver beacause i can not see this in snippet.
generally this error occurs when there is mismatch in driver and oracle.

are other operation successful except calling stored procedure.

Shailesh
[ April 26, 2005: Message edited by: Shailesh Chandra ]
sirisha alam
Greenhorn

Joined: Dec 17, 2002
Posts: 13
Hi,

yes, I am registering the driver. I am able to call the stored procedures also succesfully, if the out parameter is not a cursor. The only issue i have is with the cursors.
Yogesh Gandhi
Ranch Hand

Joined: Dec 05, 2008
Posts: 206
The mistake I was doing and getting the same exception was
While preparing the PreparedStatement Object, i was passing the query like this



And while executing it, again I was giving the query in the overloaded method.



Use the executeUpdate method without arguments and not the one with a String argument

After making this change, I didn't get this exception.

Exact root cause is still unknown to me as well.

If someone understands it better, please explain it to me as well.


Also to set the clob data in the database you can use the following
Sujoy Choudhury
Ranch Hand

Joined: Sep 17, 2008
Posts: 136

The reason is very simple.

You have already created the prepared statement using your sql. And then you have replaced all "?" using setters.
After that again you are passing your old sql (which has "?" char/s inside) to the method.
If you pass your old sql it will use that sql to fire the query and obviously "?" char/s didn't get replaced so you get the error.

I hope this helps.


Thanks and Regards,
~Sujoy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: ORA-03115: unsupported network datatype or representation
 
Similar Threads
Tomcat + NullPointerException
Validator with Struts Problem ?
Kindly help with the "cannot connect to the database" error
getting a 500 error
Problem with Jakarta Commons Fileupload