Solved

A CheckBox Problem

Posted on 1998-08-26
1
168 Views
Last Modified: 2010-03-30
In my database, the type of the field "GreenXY" is Text. So the following code is wrong -- Can't convert java.lang.String to bollean. Can you tell me how to correct it?

ckbGreen.setState( rs.getString("GreenXY"));
0
Comment
Question by:Jun080298
1 Comment
 
LVL 3

Accepted Solution

by:
mjenkins earned 10 total points
ID: 1222623
Assuming that GreenXY holds "TRUE" and "FALSE":

String s = rs.getString("GreenXY");
ckbGree.setState( s.equals("TRUE") );

the equals() method returns a boolean value.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ArrayIndexOutOfBoundException 9 66
thymeleaf natural templating vs JSP 2 66
Java SE 8u111  Lot of stuff broke 11 53
netstat -ano | find "8000" and taskkill /f /pid 2984 3 30
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now