SQL question

H

hoho123

I have a column type char in a sybase database. what do I need to do in
the preparedStatement to set a string type to char?

Thanks in advance
 
C

Chris Smith

hoho123 said:
I have a column type char in a sybase database. what do I need to do in
the preparedStatement to set a string type to char?

PreparedStatement's setString is the correct method to call for the SQL
CHAR data type. Unless you're calling setNull, you don't need to
specify the type. If you are calling setNull, then you may specify the
type as java.sql.Types.CHAR.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top