• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLException - Invalid Column Type

 
Claudio Gualberto
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
I have a Servlet inserting lines on a Oracle table, and i'm having problems with the PreparedStatement interface.
When it tries to insert a line where some column value is null, the database rises the titled exception, even when the column is not required. Should i filter the values before building the statement to avoid null values ?
Any kind of help will be welcome.
Claudio Gualberto , Brazil
 
Michael Zalewski
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling myPreparedStatement.setString( MY_NULL_COLLUMN, "") might work. If not, try myPreparedStatement.setNull( MY_NULL_COLUMN, Types.XXXX) (Look up Types to figure out what to put for XXXX)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic