File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: "")