Solved

A CheckBox Problem

Posted on 1998-08-26
1
180 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java DateChooser? 3 36
Should localization be done inside spring controller 5 25
Oracle SQL syntax check  without executing 6 54
servlet example issue 6 38
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

770 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