| Home | JSP | EJB | JDBC | Java Servlets | WAP | Free JSP Hosting | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML | ||||
|
||||
|
|
||||
| Tutorial Categories: Ajax
| Articles
| JSP
| Bioinformatics
| Database
| Free
Books |
Hibernate
| J2EE
| J2ME
| Java
| JavaScript
| JDBC
| JMS
| Linux
| MS
Technology |
PHP
| RMI
| Web-Services
| Servlets
| Struts
| UML
|
|
||||||||||||||||||||||||||||||
|
Home | JSP | EJB | JDBC | Java Servlets | WAP | Free JSP Hosting | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs |
||||||||||||||||||||||||||||||
Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.
Copyright © 2007. All rights reserved.
Current Comments
13 comments so far (post your own) View All Comments Latest 10 Comments:Thanks a lot for ur helping tendency....
Its really very helpful 4 us....
Actually in my company v r working in MyEclipse, jsp projects using struts....My SQL is working as database. . .
need this kind of coding more. . . please help us.
Thanks and Regards. Juliet.
Posted by jyo on Thursday, 11.13.08 @ 02:25am | #81634
hi this is gayathri i want coding in userid is already exist or not how check i want coding using jsp,servlet with javascript
if enter the uid it display the alert msg pls very urgent
Posted by gayathri on Thursday, 09.18.08 @ 12:27pm | #80273
site is very nice...i suggest you to plz add some free ebooks downloads to d site ..
Posted by jitin khurana on Saturday, 08.9.08 @ 07:37am | #71840
thank u for this lesson, now i want to learn how to connect to the database from JSP page.
Posted by islam on Friday, 04.4.08 @ 20:40pm | #55332
I have a daubt about the database connection that how the system find the actual server without using the connection poling in the above jsp code.
con = DriverManager.getConnection("jdbc:mysql://localhost/test","root","mysql");
here what is test is it the context or the DBName.?
Posted by sreejith on Monday, 02.18.08 @ 16:30pm | #48884
<%@ page language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%! Connection con=null; %>
<%! Statement st= null; %>
<%! ResultSet rs= null; %>
<%! boolean found =false; %>
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
try
{
con = DriverManager.getConnection("jdbc:mysql://localhost/test","root","mysql");
out.println("System connected\n");
st = con.createStatement();
String s1=request.getParameter("uname");
//out.println(s1);
rs=st.executeQuery("select * from user where name='"+s1+"'");
session.setAttribute("name",s1);
String s2=request.getParameter("pswd");
//out.println("After Executing the Query" + rs);
while(rs.next())
{
out.println(rs.getString(s1));
String rs1=rs.getString(1);
//session.setAttribute("user");
String rs2=rs.getString(2);
if(s2.equalsIgnoreCase(rs2))
{
int id=rs.getInt("userid");
//out.println("After Executing the Query" );
int userid=rs.getInt("userid");
out.println(userid);
}
}
}
catch(Exception e)
{
System.out.println("validation failure"+e);
}
finally
{
st.close();
rs.close();
con.close();
}
%>
THE ERROR IS
System connected After Executing the Querycom.mysql.jdbc.ResultSet@13c4c09
Posted by ujwala on Friday, 11.16.07 @ 10:20am | #37546
I want to learn how to connect to the database from JSP page.
Thank you~~~~~~
Posted by meehuajang on Saturday, 11.3.07 @ 13:24pm | #35452
how can connect datebase mysql
i want class level coding....
please help me..
very urgent
Posted by rameesh on Friday, 10.5.07 @ 11:46am | #31785
hi
i want to know
how to pass database argument to jsp form from servlet
Posted by prakash on Thursday, 09.27.07 @ 10:54am | #30061
good
Posted by vasudha on Tuesday, 06.12.07 @ 11:30am | #18968
How do i access SQL database (fields) from JSP using Username and Password.
Posted by Benny Mangwane on Tuesday, 04.17.07 @ 17:55pm | #14441
HI,
Please visit Accessing database from JSP to learn how to Connect to Database from JSP page.
Thanks
Posted by Deepak Kumar on Friday, 03.23.07 @ 20:38pm | #12574
I Want To Connect Jsp Page with mysql how a can do ?
Posted by Ashish on Friday, 03.23.07 @ 12:09pm | #12544