Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~131 People Reached
Favorite Forums
Favorite Tags
jsp x 1
Member Avatar for Rahul17

I have written this code in Jsp file . [code=JSP]<% Connection con=null; Statement st=null; PreparedStatement ps; String nm=request.getParameter("tnm"); String loc=request.getParameter("tlc"); try { Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/rahul","root","root"); st=con.createStatement(); try { ps=con.prepareStatement("insert into dept(deptname,location) values(?,?)"); ps.setString(1,nm); ps.setString(2,loc); ps.executeUpdate(); out.println("Value inserted "); } catch(SQLException e) { out.println("sql is not executed"); } } catch(Exception ex) { …

Member Avatar for jwenting
0
131