You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by zafar Ahsan <za...@lycos.com> on 2003/03/10 08:16:23 UTC

Pls help me !! Urgent!

hello
Can any one pls let me know how to deals with null that result set returns when quering from an oracle database. its display "null" when using rset.getString() method and i want it to be either 0 or " "(nothing).Am novice to java and tomcat and null being a special literal in java cosing me problem to get up to my work.
I would be very thankful for yr kind help.
And if don't mind pls let me also know how to start tomcat server through windows server2000 services.
Md. Zafar Ahsan


_____________________________________________________________
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Pls help me !! Urgent!

Posted by Giorgio Ponza <gi...@opla.it>.
Hi Zafar

I wrote this very simple method
public final static String getString(String pOriginal) {if (pOriginal ==
null) return new String();return pOriginal;}

and i use it to retrieve strings that can be null, getting in this case a
new string.

bye bye

Giorgio




----- Original Message -----
From: "zafar Ahsan" <za...@lycos.com>
To: <to...@jakarta.apache.org>
Sent: Monday, March 10, 2003 8:16 AM
Subject: Pls help me !! Urgent!


> hello
> Can any one pls let me know how to deals with null that result set returns
when quering from an oracle database. its display "null" when using
rset.getString() method and i want it to be either 0 or " "(nothing).Am
novice to java and tomcat and null being a special literal in java cosing me
problem to get up to my work.
> I would be very thankful for yr kind help.
> And if don't mind pls let me also know how to start tomcat server through
windows server2000 services.
> Md. Zafar Ahsan
>
>
> _____________________________________________________________
> Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
> http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Pls help me !! Urgent!

Posted by Kwok Peng Tuck <pe...@makmal.net>.
For columns that return null values why don't you check if the 
rset.getString() returns null?

If you installed tomcat with the exe rather then there is a option for 
you to install tomcat as a service. I think the program that tomcat uses 
to do this is freely available but escapes me at the moment. Try doing a 
google for javant service or something like that.

zafar Ahsan wrote:

>hello
>Can any one pls let me know how to deals with null that result set returns when quering from an oracle database. its display "null" when using rset.getString() method and i want it to be either 0 or " "(nothing).Am novice to java and tomcat and null being a special literal in java cosing me problem to get up to my work.
>I would be very thankful for yr kind help.
>And if don't mind pls let me also know how to start tomcat server through windows server2000 services.
>Md. Zafar Ahsan
>
>
>_____________________________________________________________
>Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
>http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Pls help me !! Urgent!

Posted by Bill Lunnon <bi...@mirrim.com.au>.
Zafar,

You need to test for the null after you have retrived the parameter from the
query, via jdbc ResultSet.wasNull()

Code might look like

CallableStatement cs;
// setup the callable statement stuff prior to here
ResultSet rs = cs.executeQuery();

while (rs.next()) {
	String param = rs.getString(pos);
	if (rs.wasNull() == true) {
		// set preferred param value
		param = "0"; // or ""
	}
}

Hope this helps

Bill
-----Original Message-----
From: zafar Ahsan [mailto:zafarahsan0@lycos.com]
Sent: Monday, 10 March 2003 6:16 PM
To: tomcat-user@jakarta.apache.org
Subject: Pls help me !! Urgent!


hello
Can any one pls let me know how to deals with null that result set returns
when quering from an oracle database. its display "null" when using
rset.getString() method and i want it to be either 0 or " "(nothing).Am
novice to java and tomcat and null being a special literal in java cosing me
problem to get up to my work.
I would be very thankful for yr kind help.
And if don't mind pls let me also know how to start tomcat server through
windows server2000 services.
Md. Zafar Ahsan


_____________________________________________________________
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org