This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes java.sql.SQLException: Internal Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: Internal Error" Watch "java.sql.SQLException: Internal Error" New topic
Author

java.sql.SQLException: Internal Error

Mohammed Eesa
Greenhorn

Joined: May 06, 2004
Posts: 17
hai all,
Iam using Oracle 9i.I am getting error When i access the Oracle Type through Java.

my Code is

con = connectionFactory.getConnection();
csmt = con.prepareCall("call PMS_PR_area_SIGN_CONTROL ( ?,?,?,?,?)");
csmt.setInt(1, groupId);
csmt.setString(2,startDate);
csmt.setString(3,endDate);
csmt.registerOutParameter(4,Types.ARRAY, "PMS_TY_TAB_SG_CNTRL");
csmt.registerOutParameter(5,Types.VARCHAR);
csmt.execute();
oracle.sql.ARRAY.oracleARRAY = (oracle.sql.ARRAY.ARRAY)csmt.getArray(4);
rs = oracleARRAY.getResultSet();
while (rs.next())
{
/**
below line gives error
*/
oracle.sql.STRUCT STRUCT struct=(oracle.sql.STRUCT.STRUCT)rs.getObject(2);//getting error at this line
Object[] resultObj = struct.getAttributes();

}
Stack Trace is
java.sql.SQLException: Internal Error
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:274)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:949)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:996)
at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:91)
at oracle.sql.TypeDescriptor.initSQLName(TypeDescriptor.java:128)
at oracle.sql.TypeDescriptor.getName(TypeDescriptor.java:103)
at oracle.sql.StructDescriptor.getClass(StructDescriptor.java:415)
at oracle.sql.STRUCT.toJdbc(STRUCT.java:365)
at oracle.jdbc.oracore.OracleTypeUPT.unpickle80rec(OracleTypeUPT.java:236)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80rec_elems(OracleTypeCOLLECTION.java:553)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80rec(OracleTypeCOLLECTION.java:383)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80(OracleTypeCOLLECTION.java:329)
at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:218)
at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:501)
at oracle.sql.ARRAY.getArray(ARRAY.java:214)
at it.sella.pms.dao.TimeSheetReportDAO.getSignControlByGroup(TimeSheetReportDAO.java:409)

I am getting problem in Converting to STRUTS

Can any one help me.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Mohammed,
There are examples of how to do this on Oracle's OTN Web site. Have you looked here:

http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/index.html

and here:

http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/index.html

Good Luck,
Avi.
 
jQuery in Action, 2nd edition
 
subject: java.sql.SQLException: Internal Error
 
Similar Threads
Exhausted Resultset Exception
Exception in thread "main" java.sql.SQLException: No suitable driver
entity bean problem
Getting array of Oracle Objects
OracleDatasource with Eclipse