This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes  Atten : Mr. Yogen Vadnere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark " Atten : Mr. Yogen Vadnere" Watch " Atten : Mr. Yogen Vadnere" New topic
Author

Atten : Mr. Yogen Vadnere

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Thanks for ur help.
The following is my code.

<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>

<% String ssn1 = request.getParameter("txtSsn") ;<br /> String lastname = request.getParameter("txtLastname");<br /> String firstname=request.getParameter("txtFirstName");<br /> String email=request.getParameter("txtEmail");<br /> String gender=request.getParameter("cboGender");<br /> String degree=request.getParameter("cboDegree");<br /> String major1=request.getParameter("cboMajor1");<br /> String major2=request.getParameter("cboMajor2");<br /> String graduationdate=request.getParameter("txtGraduationDate");<br /> String authorization=request.getParameter("cboAuthorization");<br /> String jobtype=request.getParameter("cboJobType");<br /> String gpa1=request.getParameter("txtGpa");<br /> String skill=request.getParameter("txtSkills");<br /> int ssn;<br /> double gpa;<br /> String driver = "sun.jdbc.odbc.JdbcOdbcDriver";<br /> String url = "jdbc dbc:Resume"; <br /> <br /> ssn=Integer.parseInt(ssn1);<br /> gpa=Double.parseDouble(gpa1);<br /> Class.forName(driver);<br /> Connection con=null;<br /> try{<br /> con=DriverManager.getConnection(url);<br /> /*String sql=*/<br /> Statement stmt=con.createStatement();<br /> stmt.executeUpdate("insert into Profile values(ssn,'lastname','firstname','email','gender','degree','major1','major2','graduationdate','authorization','jobtype',gpa,'skill')"); <br /> stmt.close();<br /> stmt=null;<br /> }<br /> finally{<br /> if(con!=null){<br /> con.close();}<br /> }<br /> %>

Yogen Vadnere
Ranch Hand

Joined: Sep 20, 2001
Posts: 58
Where is ur code ???


Yogen Vadnere
vikram nalagampalli
Ranch Hand

Joined: Oct 08, 2001
Posts: 91
Originally posted by Yogen Vadnere:
Where is ur code ???

my code
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>

<% String ssn1 = request.getParameter("txtSsn") ;<br /> String lastname = request.getParameter("txtLastname");<br /> String firstname=request.getParameter("txtFirstName");<br /> String email=request.getParameter("txtEmail");<br /> String gender=request.getParameter("cboGender");<br /> String degree=request.getParameter("cboDegree");<br /> String major1=request.getParameter("cboMajor1");<br /> String major2=request.getParameter("cboMajor2");<br /> String graduationdate=request.getParameter("txtGraduationDate");<br /> String authorization=request.getParameter("cboAuthorization");<br /> String jobtype=request.getParameter("cboJobType");<br /> String gpa1=request.getParameter("txtGpa");<br /> String skill=request.getParameter("txtSkills");<br /> int ssn;<br /> double gpa;<br /> String driver = "sun.jdbc.odbc.JdbcOdbcDriver";<br /> String url = "jdbc dbc:Resume"; <br /> <br /> ssn=Integer.parseInt(ssn1);<br /> gpa=Double.parseDouble(gpa1);<br /> Class.forName(driver);<br /> Connection con=null;<br /> try{<br /> con=DriverManager.getConnection(url);<br /> /*String sql=*/<br /> Statement stmt=con.createStatement();<br /> stmt.executeUpdate("insert into Profile values(ssn,'lastname','firstname','email','gender','degree','major1','major2','graduationdate','authorization','jobtype',gpa,'skill')"); <br /> stmt.close();<br /> stmt=null;<br /> }<br /> finally{<br /> if(con!=null){<br /> con.close();}<br /> }<br /> %>

vikram nalagampalli
Ranch Hand

Joined: Oct 08, 2001
Posts: 91
cAN U PLS CLICK THE REPLY/WQUOTE LINK. i DONT KNOW WHY MY CODE IS NOT SHOWING UP OUT THERE.
THANKS
 
 
subject: Atten : Mr. Yogen Vadnere
 
Similar Threads
Insert Query Not working
Problem when Retreiving from DataBase
Problem integrating Input box with JSP
login
Need Help with check box values!