Search code examples
javaapijdbcresultset

How to get the char data type from mysql using resultset


I have been doing CRUD operation on database, but i could not find any direct method for the getting the data type char in database.

Though i achieved the output using the getString(String column_name) of the result set, but i wonder why there does not exist any method like getChar(String column_name), since String and Character are two different data types.


Solution

  • Refer to the link and see the table 3-1 and you will get decent idea that why there does not exists getChar(String column_name).

    Summary: Mapping of char is to String. So there exists getString(String column_name) for the char data type