User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 425,968 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,635 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 6784 | Replies: 0
Reply
Join Date: Apr 2004
Location: in a galaxy far far away :)
Posts: 121
Reputation: johnroach1985 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
johnroach1985's Avatar
johnroach1985 johnroach1985 is offline Offline
Junior Poster

Help connecting to mssql with using jsp

  #1  
Oct 10th, 2004
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 cool idea ain't it all original .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>
 
 
Last edited by johnroach1985 : Oct 10th, 2004 at 1:11 pm. Reason: java changed to jsp
------

"A rational anachist believes that concepts such as 'state' and 'society' and 'government' have no existence save as physically exemplified in acts of self-responsible individuals.He believese that it is impossible to shift blame,share blame,distrubute blame.... as blame,guilt,responsibility are matters taking place inside human beings singly and nowhere else.But being rational,he knows that not all individuals hold his evaluations,so he tries to live perfectly in an imperfectworld...aware that his effort wil be less than perfect yet undismayed by self-knowledge of self-failure."

-Robert A. Heinlein

-----
John Roach
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 10:59 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC