johnroach1985 0 Junior Poster

Hi just started this new jsp course stuck in this so if you guys can please help would be very happy.The problem is this i am trying to make a jsp that asks for a username and a password and the thing is i am trying to put these datas into a database:D cool idea ain't it all original:idea: .but the problem is that i can't get connected to sql i don't know it just won't work bet i made millions of mistakes i am not aware of.Anyways a simple site to test it.My data base is named pass the and the password is pass to make it easy;) .And i am usin an apache-tomcat 5.0.28 and a 1.4java thats all you need i thinks if you need more please post i am just a desperate student trying to learn:) .Oh the code here it is...
P.S.:please help me don't just read and pass please pretty please:cry: :cheesy:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Mr.Duke Is Back</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
public void baglan(){
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:pass","pass","pass");
	 }
	 catch (Exception ex) {%><%
 
	 out.print("alert()");
	 %><%}
String name=request.getParameter("name");
String pass=request.getParameter("password");
String sql="INSERT INTO pass (marka, tip, seri, fiyat, ekran)";
sql +=" VALUES (N'"+name+"', N'"+pass+"')";
%>
<p align="center"><a href="register.htm" >Registration</a>&nbsp;&nbsp;&nbsp;<a href="login.htm">Log In</a>&nbsp;&nbsp;&nbsp;<a href="">Contact Us</a></p>
<p align="center">&nbsp;</p>
<p align="center"><img src="duke_kahve_fincani.gif" width="96" height="112"></p>
<p align="center"><font size="+3" color="#009933"><b>Disributor Network System</b></font> </p>
<p align="center"><font size="+2" color="#009933"><b>Log In</b></font> </p>
<form action="index2.htm">
<table>
<tr>
<td>Name:</td>
<td><input name="name" type="text" size="25"></td>
</tr>
<tr>
<td>Password:</td>
<td><input name="password" type="password" size="25"></td>
</tr>
</table>
<p align="center">
	<input type="submit" name="Submit" value="Submit">&nbsp;&nbsp;&nbsp;
	<input type="reset" name="Submit2" value="Reset">
</p>
</form>
<a href="register.htm">New members click here!</a>
<p align="center" > <img src="computerbanner.gif" width="400" height="70"></p>
<p > </p>
</body>
</html>