944,051 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 9041
  • JSP RSS
Oct 10th, 2004
0

connecting to mssql with using jsp

Expand Post »
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:
JSP Syntax (Toggle Plain Text)
  1.  
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  3. "<a rel="nofollow" href="http://www.w3.org/TR/html4/loose.dtd" target="_blank">http://www.w3.org/TR/html4/loose.dtd</a>">
  4. <html>
  5. <head>
  6. <title>Mr.Duke Is Back</title>
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  8. </head>
  9. <body>
  10. <%
  11. public void baglan(){
  12. try {
  13. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  14. conn=DriverManager.getConnection("jdbc:odbc:pass","pass","pass");
  15. }
  16. catch (Exception ex) {%><%
  17.  
  18. out.print("alert()");
  19. %><%}
  20. String name=request.getParameter("name");
  21. String pass=request.getParameter("password");
  22. String sql="INSERT INTO pass (marka, tip, seri, fiyat, ekran)";
  23. sql +=" VALUES (N'"+name+"', N'"+pass+"')";
  24. %>
  25. <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>
  26. <p align="center">&nbsp;</p>
  27. <p align="center"><img src="duke_kahve_fincani.gif" width="96" height="112"></p>
  28. <p align="center"><font size="+3" color="#009933"><b>Disributor Network System</b></font> </p>
  29. <p align="center"><font size="+2" color="#009933"><b>Log In</b></font> </p>
  30. <form action="index2.htm">
  31. <table>
  32. <tr>
  33. <td>Name:</td>
  34. <td><input name="name" type="text" size="25"></td>
  35. </tr>
  36. <tr>
  37. <td>Password:</td>
  38. <td><input name="password" type="password" size="25"></td>
  39. </tr>
  40. </table>
  41. <p align="center">
  42. <input type="submit" name="Submit" value="Submit">&nbsp;&nbsp;&nbsp;
  43. <input type="reset" name="Submit2" value="Reset">
  44. </p>
  45. </form>
  46. <a href="register.htm">New members click here!</a>
  47. <p align="center" > <img src="computerbanner.gif" width="400" height="70"></p>
  48. <p > </p>
  49. </body>
  50. </html>
Last edited by johnroach1985; Oct 10th, 2004 at 2:11 pm. Reason: java changed to jsp
Similar Threads
Reputation Points: 11
Solved Threads: 0
Junior Poster
johnroach1985 is offline Offline
135 posts
since Apr 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: checkbox values
Next Thread in JSP Forum Timeline: checking to see if a coupon has expired





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC