wood burning stoves 2.0*
The moose likes JDBC and the fly likes mysql enum to java string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "mysql enum to java string" Watch "mysql enum to java string" New topic
Author

mysql enum to java string

nitin kumar
Greenhorn

Joined: Feb 11, 2004
Posts: 6
Hi all,

Please can anyone help for the following problem.
I am using mysql as database and want to retrieve values from a table which have enum as one of the columns.
when I get the value in the resultset and try to store it in a string, the value returned by the rs.getString(<column-name> is null.

how should I convert the enum value of mysql to java string ?
mysql docs says that the queries for enum returns string object.

Thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

"nitin",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Are you sure that your select is actually returning a value? When I used mySQL I never had any problems fetching enum columns.
 
 
subject: mysql enum to java string
 
Similar Threads
sharing enum contants
mysql enum to java string
Switch error: incompatible type found
Enum in java 1.4
what is the problem with my java code