?
Solved

what will rs.getBoolean() return if the field is null OR varchar 'FALSE'?

Posted on 2006-06-27
10
Medium Priority
?
1,223 Views
Last Modified: 2008-02-26
hi, as per title.
1. what will rs.getBoolean() return if the field is null?

2. if the field is varchar, and the value is 'FALSE' (for every row), if i read the value using rs.getBoolean, will i get the boolean value of 'false'?

tks
0
Comment
Question by:InNoCenT_Ch1ld
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 16

Accepted Solution

by:
suprapto45 earned 1000 total points
ID: 16997797
1. It should be false.
2. If it is 'FALSE' it will return false, but if it is 'TRUE', it will return true.

David
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1000 total points
ID: 16997802
1. false, use wasNull() to check if null

2. i don't think so
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 16997805
I think for the second point, there is a rule where we can determine whether it is true or false. Let me check for a sec

David
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 92

Expert Comment

by:objects
ID: 16997809
suck it and see :)
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 16997816
Sorry for the spam.

This is just based on my experiences and may not be right.

If your VARCHAR column is started with 'T' or even a single 'T', it should return true

but if it is started with other characters than 'T', it should return false.

Just my experiences ;)

David
0
 
LVL 3

Author Comment

by:InNoCenT_Ch1ld
ID: 16997920
let me run some experiment for point#2 first...
0
 
LVL 3

Author Comment

by:InNoCenT_Ch1ld
ID: 16998049
here's my result:

field(varchar)           getBoolean()
----------------------------------------------
'FALSE'                    false
'TRUE'                     true
'FISH'
0
 
LVL 3

Author Comment

by:InNoCenT_Ch1ld
ID: 16998061
ignore my previous comment ;-)

test:
-MS SQL SERVER 2000


here's my result:

field(varchar)           getBoolean()
----------------------------------------------
'FALSE'                    false
'TRUE'                     true
'FISH'                      false
'TANK'                     false
0
 
LVL 3

Author Comment

by:InNoCenT_Ch1ld
ID: 16998070
additional:

'T'       --> false
'F'       --> false

guess it only recognize 'TRUE' for ms sql server.. or maybe it depends on the jdbc...
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 16998076
>>"'TANK'                     false"
Ok, my theory is wrong :(.

Enjoy ;)
David
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
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.
Suggested Courses

765 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