From: | Matt Fair <matt(at)netasol(dot)com> |
---|---|
To: | pgsql-interfaces(at)postgresql(dot)org |
Subject: | Connection.setBytes() |
Date: | 2000-07-18 18:38:25 |
Message-ID: | 3974A420.265E7650@netasol.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces pgsql-novice |
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.<init>(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
From | Date | Subject | |
---|---|---|---|
Next Message | Joachim Achtzehnter | 2000-07-18 18:54:37 | Re: Connection.setBytes() |
Previous Message | John Thorhauer | 2000-07-18 18:36:32 | jdbc how to get SERIAL |
From | Date | Subject | |
---|---|---|---|
Next Message | Joachim Achtzehnter | 2000-07-18 18:54:37 | Re: Connection.setBytes() |
Previous Message | Warren Odom | 2000-07-18 13:47:41 | How to get ODBC going? |