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 prepareStatement() returns 0 value 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 "prepareStatement() returns 0 value" Watch "prepareStatement() returns 0 value" New topic
Author

prepareStatement() returns 0 value

Tijo Mathew
Greenhorn

Joined: Mar 12, 2012
Posts: 16
Hi

I am using the following code in struts. When i call this method from an action class, it prints null value. It not inserting values in to database. Any help is appreciable.



Thanks in advance
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Just call db.printStackTrace(). It will show you the error itself, and its cause if it has one.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Tijo Mathew
Greenhorn

Joined: Mar 12, 2012
Posts: 16
thanks...i rectified the error....
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Would you mind telling us what the error was? That way somebody else may learn from it in the future.
Tijo Mathew
Greenhorn

Joined: Mar 12, 2012
Posts: 16
actually it was date mismatching with MYSQL date data type. I got through using the db.printStackTrace() in my code. Thanks for help.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: prepareStatement() returns 0 value
 
Similar Threads
Finding Nth Largest element of an array without sorting
this code is giving file not found exception
Getting the arraylist through session
Working with registry
urgent help needed in JTable !!!!!!!!!!!!!!