This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: Internal Error

 
Mohammed Eesa
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic