I do not understand the exception

Поиск
Список
Период
Сортировка
От Jaap Bril
Тема I do not understand the exception
Дата
Msg-id 200408241202.31945.Jaap.Bril@inter.nl.net
обсуждение исходный текст
Ответы Re: I do not understand the exception
Список pgsql-jdbc
I dont get the error here,

the exception is
    SQLEXCEPTION:Storing thumbnail failed:
    java.sql.SQLException: ERROR:  Bad int8 external representation
    "\377\330\377\340\  [.........]

The offending code is:
    private void storeThumbnail(ConnectionPool connectionPool, byte[] tn) {
        String thumbnail_insert = "INSERT INTO thumbnails VALUES (?)";
        try {
            dbConn = connectionPool.getConnection();
            dbConn.setAutoCommit(false);
            PreparedStatement ps = dbConn.prepareStatement(thumbnail_insert);
            ps.setBytes(1, tn);
            ps.executeUpdate();
            ps.close();
        }
        catch (SQLException e){
            System.out.println("SQLEX:Storing thumbnail failed: " + e );
        }
    }


       tn is a
        ByteArrayOutputStream().toByteArray() filled with a
        JPEGCodec.createJPEGEncoder()


The table thumbnails has a bytea and a serial;

What can be wrong??

TIA
Jaap


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Barry Lind"
Дата:
Сообщение: Re: types used for JDBC BLOB and CLOB?
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: I do not understand the exception