Solved

A CheckBox Problem

Posted on 1998-08-26
1
160 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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
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.

771 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

10 Experts available now in Live!

Get 1:1 Help Now