I cannot find any method like
char c = ‘c’;
preparedStatement.setChar(1, c);
How to set character to a prepared statement?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The JDBC Specification 4.0 in Appendix B (Data Type Conversion Tables) states the following conversions:
This table also shows the conversions used by the SQLInput reader methods, except that they use only the recommended conversions.
TABLE B- 1 JDBC Types Mapped to Java Types
Therefore
PreparedStatement.setString(1, String.valueOf(myChar))should do the trick.