Announcement Announcement Module
Collapse
No announcement yet.
Unable to retrieve multiple domain objects. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to retrieve multiple domain objects.

    Hi,

    Using JdbcTemplate I am trying to retrieve the domain model object using queryForObject() and query() methods.

    I am using Oracle 9.2 version. I have attached all the necessary code for reference.

    I am able to retrieve a single domain object successfully. However, I am facing issues when retrieving multiple objects - I am getting the following exception :

    Exception in thread "main" org.springframework.jdbc.UncategorizedSQLException : StatementCallback; uncategorized SQLException for SQL [SELECT EMPNO, ENAME, JOB, SAL FROM EMP]; SQL state [null]; error code [17059]; Fail to convert to internal representation; nested exception is java.sql.SQLException: Fail to convert to internal representation
    at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:83)
    at org.springframework.jdbc.support.AbstractFallbackS QLExceptionTranslator.translate(AbstractFallbackSQ LExceptionTranslator.java:80)
    at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:407)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:458)
    at org.springframework.jdbc.core.JdbcTemplate.query(J dbcTemplate.java:466)
    at JdbcTemplateSelectTest.doSelectOperations(JdbcTemp lateSelectTest.java:82)
    at JdbcTemplateSelectTest.main(JdbcTemplateSelectTest .java:24)
    Caused by: java.sql.SQLException: Fail to convert to internal representation
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:269)
    at oracle.jdbc.driver.OracleStatement.getDoubleValue( OracleStatement.java:4479)
    at oracle.jdbc.driver.OracleResultSetImpl.getDouble(O racleResultSetImpl.java:567)
    at JdbcTemplateSelectTest$2.mapRow(JdbcTemplateSelect Test.java:90)
    at org.springframework.jdbc.core.RowMapperResultSetEx tractor.extractData(RowMapperResultSetExtractor.ja va:92)
    at org.springframework.jdbc.core.JdbcTemplate$1QueryS tatementCallback.doInStatement(JdbcTemplate.java:4 48)
    at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:396)
    ... 4 more

    Please let me know if I am missing something.

    Warm Regards,
    Sreeram Ediga
Working...
X