In the following method: -
public boolean isMemberAlive(String userSsn) throws SQLException
-
{
-
boolean isMemberAlive = false;
-
-
Connection c = null;
-
Statement s = null;
-
ResultSet rs = null;
-
-
String strSQL = "SELECT Count(*) AS RecordCount " +
-
"FROM crs.memmst " +
-
"WHERE memmst_ssn = '" + userSsn + "' AND " +
-
"(memmst_dt_death IS NULL OR
-
TRIM(memmst_dt_death) = '')";
-
-
try
-
{
-
c = CnxOracle.getConnection(schema, schemapwd);
-
s = c.createStatement();
-
rs = s.executeQuery(strSQL);
-
-
if (rs.next())
-
{
-
if (rs.getInt("RecordCount") > 0)
-
{
-
isMemberAlive = true;
-
}
-
}
-
}
-
catch (SQLException exception)
-
{
-
recordException(exception);
-
}
-
finally
-
{
-
rs.close();
-
s.close();
-
c.close();
-
-
rs = null;
-
s = null;
-
c = null;
-
}
-
-
return isMemberAlive;
-
}
-
At line #21... if (rs.next()) - the resultset contains a record, rs.next() returns true (I checked using a breakpoint), but the statements in the if block are not executed. The code jumps immediately to the finally block.
This is happening in several (new) methods I've written, but older methods containing similar logic / syntax are working fine.
What is wrong???
Thanks,
Woody
3 9012
Perhaps an exception is being thrown. Put a println in your catch block and see if it executes.
Nope... I put println statements in the if block and the catch block - not executing either of 'em. <sigh>
I'm playing around with Connection scoping, now... I wonder if using these similarly-named connections / statements / resultsets within multiple methods, within multiple DAO's might be introducing a conflict?
Well if the code is not getting into the if for rs.next() then it means that rs.next() returned false. You made a mistake in your debugging.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: vakap |
last post by:
function show() {
var s = '' ;
for (var i = 0; i<arguments.length; s += '\n'+arguments) ;
typeof(window) != 'undefined' ? window.alert(s) : WScript.Echo(s) ;
}
function f(){}
show('delete(f):',delete(f)) ; // false
g = function(){} ;
|
by: John Moore |
last post by:
Hi,
I must be missing something obvious.
I cannot get this function to run the update query on Line 6, although
the call to run the query evaluates true, and both update_cat_total
functions execute, while the function itself returns true.
A var_dump shows that all the variables are valid, and I can run the
exact same update query at the mysql command line without errors. I've
|
by: Sly |
last post by:
Hi!
I am facing an unbreakable wall.
I have a class 'x' with one array in it called arr;
in Equals(x arg) routine I compare the elements of the
array.
But first I check whether
if( arg.arr == null )
{
return( false ) ;
|
by: Tim Begin |
last post by:
I am attempting to use the ThreadPool.SetMinThreads method as shown in the MSDN example code:
int minWorker, minIOPort;
int newWorker,newIOPort;
ThreadPool.GetAvailableThreads(out minWorker, out minIOPort);
bool flag = ThreadPool.SetMinThreads(4, minIOPort);
ThreadPool.GetAvailableThreads(out newWorker, out newIOPort);
After running this flag is true, but the worker value is still set to 25.
I am using .Net 1.1.4322 and this call was...
|
by: Pierre Quentel |
last post by:
Hi all,
In some program I was testing if a variable was a boolean, with this
test : if v in
My script didn't work in some cases and I eventually found that for v =
0 the test returned True
So I changed my test for the obvious "if type(v) is bool", but I still
find it confusing that "0 in " returns True
| |
by: ross.oneill |
last post by:
Hi,
Is there any function in php that will match a word exactly and if it
finds it, it returns true.
For example if I search for "CA"
strVar = "Bob is from Los Angeles CA" - return true
strVar "Bob is from Canada" -- returns false
|
by: SupraFast |
last post by:
I have two hosting accounts. On one, my setcookie script works fine; cookies are created. On the other, the same script doesn't work. The function returns TRUE, but no cookies is created.
I checked to make sure that the variables have values and that the proper expire time is set and etc.
Any ideas?
<?php
foreach($_POST as $name => $value){
if($name == 'hItem'){
$item = $value;
|
by: code green |
last post by:
I have this piece of code to tidy up after a function that calls move_uploaded_file()
if(file_exists($destination.$filename))
{
$exitmsg .=
"<br>File still in temporary location
<br>$filename
<br>Attempting deletion ";
if(unlink($destination.$filename))
$exitmsg .= '<br>Success deleting. Please try again ';
else
|
by: muthukumaran08 |
last post by:
I have textboxes and dropdownlist on my page. And i have image button when i click this image button i m validating textboxes on javascript and if it returns true, i need to do a post back to save the values. If it is returns false it should not post back.
Please do help me on this.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |