import java.io.*;
import java.sql.*;
import javax.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Slip22 extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out=response.getWriter();
String modelno=request.getParameter("modelno");
String modelname=request.getParameter("modelname");
Connection con;
Statement state;
ResultSet rs;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:mobile");
String sql="insert into mobile values(?,?)";
PreparedStatement p=con.prepareStatement(sql);
p.setString(1,modelno);
p.setString(2,modelname);
p.executeUpdate();
out.println("Record Inserted");
p.close();
con.close();
}catch(Exception e)
{
System.out.println(e);
}
}
}
very nice and helpful content.
ReplyDeletevisit: Advance Java
Really nice way to present your blog and information is also too good. Thanks for sharing it. If you are searching for professional job oriented courses than visit here:-
ReplyDeleteDigital Marketing Course In Jaipur
Web Designing Course In Jaipur
Python Training in Jaipur
Data Science Course in Jaipur
Artificial Intelligence Course In Jaipur
Online Tally Course