lesteryu / log4jdbc

Automatically exported from code.google.com/p/log4jdbc
0 stars 0 forks source link

java.lang.RuntimeException: ResultSet.getXXX(colName): could not look up name #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a simple select to multiples tables with JOIN and columns alias. 
Example: SELECT p.id, p.name, d.name AS department FROM person p LEFT JOIN 
department d USING (id_department)
2. When try to retrieve rs.getString("department") the program thorw error.

What is the expected output? What do you see instead?
I expect retrieve the coulmn data, but throw error

What version of the product are you using?
My used versio is: log4jdbc-remix 0.2.4, based on log4jdbc 1.2 beta 2 jar for 
JDBC 4 (JDK 1.6 and 1.7)

Iam using spring, when remove the jdbc-remix datasource Spied the program work, 
but the error is present with jdbc-remix datasource.

Detail of error stack here:

java.lang.RuntimeException: ResultSet.getXXX(colName): could not look up name
    at net.sf.log4jdbc.DefaultResultSetCollector.setColIndexFromGetXXXMethodParams(DefaultResultSetCollector.java:163)
    at net.sf.log4jdbc.DefaultResultSetCollector.methodReturned(DefaultResultSetCollector.java:107)
    at net.sf.log4jdbc.ResultSetSpy.reportAllReturns(ResultSetSpy.java:89)
    at net.sf.log4jdbc.ResultSetSpy.reportReturn(ResultSetSpy.java:261)
    at net.sf.log4jdbc.ResultSetSpy.getString(ResultSetSpy.java:2553)
    at ve.com.pdvsa.intevep.edgeview.dao.imp.LevantamientoDAOImp$LevantamientoMapper.mapRow(LevantamientoDAOImp.java:256)
    at ve.com.pdvsa.intevep.edgeview.dao.imp.LevantamientoDAOImp$LevantamientoMapper.mapRow(LevantamientoDAOImp.java:1)
    at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)
    at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:1)
    at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:648)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:636)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:665)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:673)
    at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:728)
.............
........

Original issue reported on code.google.com by castocol...@gmail.com on 4 Apr 2011 at 6:36

GoogleCodeExporter commented 9 years ago
This is NOT a log4jdbc error.  

Please file the bug in the appropriate project, 
http://code.google.com/p/log4jdbc-remix/

The code that threw the exception does not even exist in log4jdbc.

Original comment by arthur.b...@gmail.com on 4 Apr 2011 at 6:44