File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQLException - Invalid Column Type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQLException - Invalid Column Type" Watch "SQLException - Invalid Column Type" New topic
Author

SQLException - Invalid Column Type

Claudio Gualberto
Ranch Hand

Joined: Oct 13, 2002
Posts: 47
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

Joined: Jun 10, 2002
Posts: 30
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)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SQLException - Invalid Column Type
 
Similar Threads
Exception setting property value with CGLIB
Saving database records problem
How to handl Null Values from Database
Multiplicity & not-null
SQLException: Invalid column type when setting null values to NUMBER type columns