This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes jsp insert into database error(java.lang.NumberFormatException: For input string: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp insert into database error(java.lang.NumberFormatException: For input string: "")" Watch "jsp insert into database error(java.lang.NumberFormatException: For input string: "")" New topic
Author

jsp insert into database error(java.lang.NumberFormatException: For input string: "")

Sam Raoh
Greenhorn

Joined: Dec 21, 2009
Posts: 5
Hi all,

I am trying to insert data from a jsp form into a table when the user clicks the submit button. I am encountering this exception.

java.lang.NumberFormatException: For input string: "type"

Here is my code:

This is the code in the form jsp:


this is my code in the sign - up bean:



and this is my dbBean's insert method:




thank you very much. any help is greatly appreciated
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Er, when do you get the exception?
Sam Raoh
Greenhorn

Joined: Dec 21, 2009
Posts: 5
Thanks Dav. I got it working..

Since you asked. It was in the JSP page.

The solution was to use:

<option value = <%= type %>>< %= strName1 %></option>



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp insert into database error(java.lang.NumberFormatException: For input string: "")
 
Similar Threads
Connecting to a database through servl
jsp and jdbc
java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integrity constraint
login
Using strings within strings to read vars?