Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PSQLException

 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to move some data from Oracle to postgres. In few occasions I am getting SQLException from postgres driver, as a result program termiates with out completion. I understand that there is something rong with my data, but I did not understand the reason for this. Can any one hrlp me ?

SQLException in createQuery
org.postgresql.util.PSQLException: Zero bytes may not occur in
string parameters.
at org.postgresql.core.v2.SimpleParameterList.setStringParamete(SimpleParameterList.java:61)
at org.postgresql.jdbc2.AbstractJdbc2Statement.bindString(AbstractJdbc2Statement.java:2025)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1155)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setString(AbstractJdbc2Statement.java:1145)
at net.assyst.databse.migration.O2P.createQuery(O2P.java:102)
at net.assyst.databse.migration.O2P.readTables(O2P.java:48)
at net.assyst.databse.migration.O2P.main(O2P.java:213)
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you setting any parameter as "" ??? It might be due to the DB driver.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanju,
If you post the part of your code that is causing the error, then someone may be able to help you. Otherwise we're just going to have to guess (like Annie did).

Good Luck,
Avi.
 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Avi,
I was asking on this context.



I was trying to read a table from Oracle and trying to insert the data into Postgres. Perl was used to insert data into Oracle. It must have inserted the NUL character too. So when I was trying to insert the same data into Postgres using JDBC, I got the exception specified in the first post. Now I cleared the problem using "str = str.replaceAll("\\u00","");" ranchers helped me in another thread. Thank you all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic