This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes calling a SQL function within my java code could somebody tell me what I did wrong? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "calling a SQL function within my java code could somebody tell me what I did wrong?" Watch "calling a SQL function within my java code could somebody tell me what I did wrong?" New topic
Author

calling a SQL function within my java code could somebody tell me what I did wrong?

noodle hamilton
Greenhorn

Joined: Jun 08, 2007
Posts: 6
Hi all:
I am just trying to call a simple sql func in my java code, and I got


here is the sql function


I tested on the DB Client and the returned values are all correct.

here is a portion of my code that is calling it


please let me know what I was doing wrong..

Thanks
noodle hamilton
Greenhorn

Joined: Jun 08, 2007
Posts: 6
ok, never mind i figured it out...
it should be setString(2 instead..
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

You're right, it has to be setString(2,...).
Also, you don't need to wrap the ip between single quotes when you bind the parameter.

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling a SQL function within my java code could somebody tell me what I did wrong?
 
Similar Threads
Please tell I'm doing something wrong and ejbs don't suck that much
Calling Oracle Stored Procedure
J2me:Question about HttpConnection
Webapp hang when calling stored procedure
Prepared Statement problem in my servlet's data manager