Solved

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

Posted on 2006-06-27
10
1,210 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 250 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 250 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

734 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