S
Steven
Hi all,
I have a webform with a pulldown menu with some number in.
When this form is submitted it should put the entered data into a database.
I tried this SQL statement :
------
PreparedStatement st = conn.prepareStatement("INSERT INTO reports (rid,
problem_typeID, description"
+ "values(?,?,?)");
st.setInt(1, 1);
st.setString(2, request.getParameter("problem_typeID"));
st.setString(3, request.getParameter("description"));
------
But this doesn't work.
The field 'problem_typeID' in the database is an Integer field.
Also tried :
------
PreparedStatement st = conn.prepareStatement("INSERT INTO reports (rid,
problem_typeID, description"
+ "values(?,?,?)");
st.setInt(1, 1);
st.setInt(2, request.getParameter("problem_typeID"));
st.setString(3, request.getParameter("description"));
------
Also doesn't work.
Replacing the line :
st.setInt(2, request.getParameter("problem_typeID"));
with for example :
st.setInt(2, 12);
Does put in the value 12 into the database.
Any idea what is wrong and how to solve this?
Thanks for any help!!
I have a webform with a pulldown menu with some number in.
When this form is submitted it should put the entered data into a database.
I tried this SQL statement :
------
PreparedStatement st = conn.prepareStatement("INSERT INTO reports (rid,
problem_typeID, description"
+ "values(?,?,?)");
st.setInt(1, 1);
st.setString(2, request.getParameter("problem_typeID"));
st.setString(3, request.getParameter("description"));
------
But this doesn't work.
The field 'problem_typeID' in the database is an Integer field.
Also tried :
------
PreparedStatement st = conn.prepareStatement("INSERT INTO reports (rid,
problem_typeID, description"
+ "values(?,?,?)");
st.setInt(1, 1);
st.setInt(2, request.getParameter("problem_typeID"));
st.setString(3, request.getParameter("description"));
------
Also doesn't work.
Replacing the line :
st.setInt(2, request.getParameter("problem_typeID"));
with for example :
st.setInt(2, 12);
Does put in the value 12 into the database.
Any idea what is wrong and how to solve this?
Thanks for any help!!