java.sql.SQLException: Unknown type '246 in column 1 of 2 in binary-encoded result set.

Spring JIRA | Vladimir Gendler | 1 decade ago
  1. 0

    I was running the example from the book "Professional Java Development with the Spring Framework" byRod Johnsonet al. from Chapter 5: DAO Support and JDBC Framework (Using the RDBMS Operation Classes): RdbmsOperationsTests.java (method public void testUpdateBookigs() ) which calls package org.springframework.prospring.ticket.db; import org.springframework.jdbc.core.SqlParameter; import org.springframework.jdbc.object.UpdatableSqlQuery; import javax.sql.DataSource; import java.sql.Types; import java.sql.ResultSet; import java.sql.SQLException; import java.math.BigDecimal; import java.util.Map; public class UpdateBookings extends UpdatableSqlQuery { public UpdateBookings(DataSource dataSource, String sql) { super(dataSource, sql); declareParameter(new SqlParameter("date_made", Types.DATE)); compile(); } public Object updateRow(ResultSet rs, int rowNum, Map context) throws SQLException { BigDecimal price = rs.getBigDecimal("price"); price = price.add((BigDecimal) context.get("increase")); rs.updateBigDecimal("price", price); return null; } } It does nothing (not updating anything) for Oracle DB (v.10g rel.2) and terminates without error For MySQL (v 5.0.18) it terminates with error: Testcase: testUpdateBookigs took 3.295 sec Caused an ERROR PreparedStatementCallback; uncategorized SQLException for SQL [select id, price from Booking where date_made > ?]; SQL state [S1000]; error code [0]; Unknown type '246 in column 1 of 2 in binary-encoded result set.; nested exception is java.sql.SQLException: Unknown type '246 in column 1 of 2 in binary-encoded result set. org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [select id, price from Booking where date_made > ?]; SQL state [S1000]; error code [0]; Unknown type '246 in column 1 of 2 in binary-encoded result set.; nested exception is java.sql.SQLException: Unknown type '246 in column 1 of 2 in binary-encoded result set. java.sql.SQLException: Unknown type '246 in column 1 of 2 in binary-encoded result set. at com.mysql.jdbc.MysqlIO.unpackNativeEncodedColumn(MysqlIO.java:4150) at com.mysql.jdbc.MysqlIO.unpackBinaryResultSetRow(MysqlIO.java:3714) at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1320) at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2261) at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:423) at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1962) at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1385) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1142) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:676) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030) at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:535) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:476) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:528) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:553) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:574) at org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:114) at org.springframework.prospring.ticket.db.RdbmsOperationsTests.testUpdateBookigs(Unknown Source)

    Spring JIRA | 1 decade ago | Vladimir Gendler
    java.sql.SQLException: Unknown type '246 in column 1 of 2 in binary-encoded result set.
  2. 0

    I was running the example from the book "Professional Java Development with the Spring Framework" byRod Johnsonet al. from Chapter 5: DAO Support and JDBC Framework (Using the RDBMS Operation Classes): RdbmsOperationsTests.java (method public void testUpdateBookigs() ) which calls package org.springframework.prospring.ticket.db; import org.springframework.jdbc.core.SqlParameter; import org.springframework.jdbc.object.UpdatableSqlQuery; import javax.sql.DataSource; import java.sql.Types; import java.sql.ResultSet; import java.sql.SQLException; import java.math.BigDecimal; import java.util.Map; public class UpdateBookings extends UpdatableSqlQuery { public UpdateBookings(DataSource dataSource, String sql) { super(dataSource, sql); declareParameter(new SqlParameter("date_made", Types.DATE)); compile(); } public Object updateRow(ResultSet rs, int rowNum, Map context) throws SQLException { BigDecimal price = rs.getBigDecimal("price"); price = price.add((BigDecimal) context.get("increase")); rs.updateBigDecimal("price", price); return null; } } It does nothing (not updating anything) for Oracle DB (v.10g rel.2) and terminates without error For MySQL (v 5.0.18) it terminates with error: Testcase: testUpdateBookigs took 3.295 sec Caused an ERROR PreparedStatementCallback; uncategorized SQLException for SQL [select id, price from Booking where date_made > ?]; SQL state [S1000]; error code [0]; Unknown type '246 in column 1 of 2 in binary-encoded result set.; nested exception is java.sql.SQLException: Unknown type '246 in column 1 of 2 in binary-encoded result set. org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [select id, price from Booking where date_made > ?]; SQL state [S1000]; error code [0]; Unknown type '246 in column 1 of 2 in binary-encoded result set.; nested exception is java.sql.SQLException: Unknown type '246 in column 1 of 2 in binary-encoded result set. java.sql.SQLException: Unknown type '246 in column 1 of 2 in binary-encoded result set. at com.mysql.jdbc.MysqlIO.unpackNativeEncodedColumn(MysqlIO.java:4150) at com.mysql.jdbc.MysqlIO.unpackBinaryResultSetRow(MysqlIO.java:3714) at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1320) at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2261) at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:423) at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1962) at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1385) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1142) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:676) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030) at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:535) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:476) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:528) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:553) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:574) at org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:114) at org.springframework.prospring.ticket.db.RdbmsOperationsTests.testUpdateBookigs(Unknown Source)

    Spring JIRA | 1 decade ago | Vladimir Gendler
    java.sql.SQLException: Unknown type '246 in column 1 of 2 in binary-encoded result set.
  3. 0

    GitHub comment 598#140930847

    GitHub | 1 year ago | g0t4
    org.flywaydb.core.api.FlywayException: Unable to check whether schema `sphereds` is empty
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Internal Error PLAYER_INTERACT

    GitHub | 4 years ago | Wherethefuckismylink
    java.sql.SQLException: Error writing file '/tmp/MYRytGnG' (Errcode: 28)
  6. 0

    MySQL Result Set - No value specified for parameter 1

    Stack Overflow | 2 years ago | Frodgers
    java.sql.SQLException: No value specified for parameter 1

  1. Kialandei 1 times, last 1 week ago
  2. poroszd 1 times, last 1 year ago
11 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.sql.SQLException

    Unknown type '246 in column 1 of 2 in binary-encoded result set.

    at com.mysql.jdbc.MysqlIO.unpackNativeEncodedColumn()
  2. MySQL jdbc
    PreparedStatement.executeQuery
    1. com.mysql.jdbc.MysqlIO.unpackNativeEncodedColumn(MysqlIO.java:4150)
    2. com.mysql.jdbc.MysqlIO.unpackBinaryResultSetRow(MysqlIO.java:3714)
    3. com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1320)
    4. com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2261)
    5. com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:423)
    6. com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1962)
    7. com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1385)
    8. com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1142)
    9. com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:676)
    10. com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030)
    10 frames
  3. Spring Framework
    SqlQuery.execute
    1. org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:535)
    2. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:476)
    3. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:528)
    4. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:553)
    5. org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:574)
    6. org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:114)
    6 frames
  4. org.springframework.prospring
    RdbmsOperationsTests.testUpdateBookigs
    1. org.springframework.prospring.ticket.db.RdbmsOperationsTests.testUpdateBookigs(Unknown Source)
    1 frame