Received: from cda.mrs.umn.edu (root@cda.mrs.umn.edu [146.57.3.11]) by hub.org (8.10.1/8.10.1) with ESMTP id e6IIcFh63477 for ; Tue, 18 Jul 2000 14:38:15 -0400 (EDT) Received: from netasol.com (ctrts1-3.mrs.umn.edu [146.57.4.203]) by cda.mrs.umn.edu (8.10.0/8.10.0) with ESMTP id e6IIc8110038 for ; Tue, 18 Jul 2000 13:38:08 -0500 (CDT) Message-ID: <3974A420.265E7650@netasol.com> Date: Tue, 18 Jul 2000 13:38:25 -0500 From: Matt Fair Organization: Netasol Networks, Inc. X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Connection.setBytes() Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200007/121 I want to set an array of bytes to a prepared statement, but it throws a null pointer exception. Here is my code: String description = new String(".........4000 Bytes......."); PreparedStatement pstmt = con.prepareStatement("INSERT INTO mytable (str) VALUES (?)"); pstmt.setBytes(1,description.getBytes()); //Line 65, throws NullPointerException here pstmt.executeUpdate(); pstmt.close(); Exception in thread "main" java.lang.NullPointerException at org.postgresql.Connection.ExecSQL(Connection.java:312) at org.postgresql.jdbc2.Statement.execute(Statement.java:273) at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54) at org.postgresql.largeobject.LargeObjectManager.(LargeObjectManager.java:106) at org.postgresql.Connection.getLargeObjectAPI(Connection.java:561) at org.postgresql.jdbc2.PreparedStatement.setBytes(PreparedStatement.java:297) ==== >at PsqlConsole.prompt(PsqlConsole.java:65) <==== at PsqlConsole.main(PsqlConsole.java:87) It throws it when I call setBytes(), I don't know what the problem is. I got the source of setBytes and put it in my code where I have setBytes(). It was throwing a null pointer when it was calling getLargeObjectAPI(). Has anyone else had this error? Thanks Matt Fair