<%@ page import="java.sql.*" %> <% String username=request.getParameter("username"); String userpass=request.getParameter("userpass"); String useremail=request.getParameter("useremail"); String useraddress=request.getParameter("useraddress"); String userstate=request.getParameter("userstate"); String usercity=request.getParameter("usercity"); String usercontact=request.getParameter("usercontact"); try{ Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","classified","classified"); PreparedStatement ps2=con.prepareStatement("select count(*) from registered");int c; System.out.println("1"); ResultSet rs=ps2.executeQuery();System.out.println("2"); if(rs.next()){c=rs.getInt(1);} else {c=0;} int id=c+101;System.out.println("11"); String query="insert into registered(id,name,password,email,address,contact) values(?,?,?,?,?,?)"; PreparedStatement ps=con.prepareStatement(query);System.out.println("111"); ps.setInt(1,id);System.out.println("1111"); ps.setString(2,username); ps.setString(3,userpass); ps.setString(4,useremail); ps.setString(5,useraddress); ps.setString(6,usercontact); int status=ps.executeUpdate(); if(status>0){ out.println("

You are successfully registered....
To view your profile and post classified
"); out.print("


"); } else{ out.println("Sorry some problem occured. Please try to register again!
if you have already an account
"); } }catch(Exception e){e.printStackTrace();} %> <%@ include file="footer.html"%>
www.000webhost.com