I want to update my oracle database column from a text box ,so whenever I input some text value in the text
box and click UPDATE button the database field should be updated . I have a drop down menu also ,so when ever I select the drop down and enter in the text box that field should be updated.
I have written the code but its not working . Please help me out its Urgent.
My jsp code
box and click UPDATE button the database field should be updated . I have a drop down menu also ,so when ever I select the drop down and enter in the text box that field should be updated.
I have written the code but its not working . Please help me out its Urgent.
My jsp code
Code:
<%@ page language="java" import="java.sql.*" %>
<%@ page import = "java.io.*"%>
<%
String id = request.getParameter("ID");
int num=Integer.parseInt(id);
String url= request.getParameter("URL");
%>
<%
try{
Connection conn = null;
Class.forName("oracle.jdbc.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:SCOTT/tiger@computer_1:1521:orcl");
Statement st= null;
st=conn.createStatement();
st.executeUpdate("UPDATE TEST_LINKS SET URL= '"+url+"'WHERE ID= '"+num+"' ");
}
catch(Exception e){
System.out.println(e);
}
%>
Comment