August 1, 2008 at 4:22 PM
Hi friend,
This is login action code.
<%@ page language="java" import="java.sql.*" import="java.util.*" %>
<%
Connection con = null;
String url = "jdbc:
mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String userName ="amar";
String password="amar123";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,userName,password);
try{
Statement st = con.createStatement();
String user=request.getParameter("userid");
String pass=request.getParameter("password");
ResultSet rs=st.executeQuery("select userid,password from login");
while(rs.next()) {
String userid =rs.getString(1);
String passw=rs.getString(2);
if(user.equals(userid) && pass.equals(passw)) {
session.setAttribute("user",user);
%>
<jsp:forward page="LoginSuccess.jsp" />
<%}
else
out.println("Login Failed,Please try Againe");
%>
<%
}
}catch(Exception e1){}
}
catch (Exception e){
e.printStackTrace();
}
%>
---------------------------------------------------
Read for more information.
http://www.roseindia.net/jdbc/Thanks.
Related Tutorials/Questions & Answers:
can't connect to MySQL Server(10060) - JDBCcan't connect to
MySQL Server(
10060) Hii Sir,
I am working with a jsp project with
MySQL as
server. Now i want to host my application. I am...
MySQL front end. Can we
connect to the
MySQL server using the I.P address
mysql error 1042 can't get hostname for your addressmysql error 1042
can't get hostname for your address Hi,
I am not able to
connect to
MySQL database. Its giving following error:
mysql error 1042...; Hi,
Find my.ini file of your
MySQL Server and then add the following line
Advertisements
Mysql connectMysql connect i can have a
mysql database file and
mysql-connector-net .but i have not
mysql database. how to
connect vb.net thsis database.(C:\Documents and Settings\Admin\My Documents\VB.NET\Stock delna\STC.sql ). plz help me
mysql_connect arguments mysql_
connect arguments How many arguments a
mysql_connection function required to
connect to the database?
?
mysql_
connect? function takes three arguments
Server - localhost
Username - admin
Password - 1admin
How to connect to MySQL in JSP?How to
connect to
MySQL in JSP? How to
connect to
MySQL in JSP...,
You can use the Java JDBC code to
connect to
MySQL database in JSP page. Check the tutorial:
Connect JSP with
mysql
Thanks
not able to connect to mysql using.. jdbc not able to
connect to
mysql using.. jdbc i am not able to
connect to
mysql using jdbc ..
is there any classpath that i need to set..because i am using
mysql-connector-java jar file..to
connect to
mysql..
Pls provide the steps
Connect JSP with mysql Connect JSP with
mysql
...
Connect JSP with
mysql :
Now in the following jsp code, you will see
how...
Output of the program when unable to
connect to specified
mysql database
Java Connect to and FTP Server the apache commons library to
connect/login to FTP
server.
Link of complete example is FTP
Server :
Connect and Login.
Thanks...Java
Connect to and FTP Server What is the code for Java
Connect how to connect mysql from gui?how to
connect mysql from gui? i am unable to connet to
mysql server from my projet that is gui for
mysql...can anyone help me in this...its urgent? i have to connet to
mysql from gui..
Hi Friend,
Try the following
could not connect to the server - JDBCcould not
connect to the server Hii sir,
I am working with a JBDC program now. Now i am trying to host it. when i am trying to
connect to the remote
MySqL server, i got an exception like
how to connect mysql with JDBC - JDBChow to
connect mysql with JDBC I have created three tables in the database
MYsql, i have to
connect them now using JDBC, can u please suggest me...();
}
}
Thanks
Rajanikant Hi friend,
To
mysql connect using JDBC
pls provide steps to connect mysql in flex - XMLpls provide steps to
connect mysql in flex hi ,PLS SUGGEST ME I HAVE NO IDEA WHERE TO PLACE THE FUNCTIONS.PHP CODE.I HAVE WAMP
SERVER .CAN I PASTE THE FUNCTIONS.PHP THERE .OR ANY OTHERWAY .HOW FLEX
CONNECT WITH WAMP .IF SO PLS
Connect JSP with mysql Connect JSP with
mysql
... how to
connect to
MySQL database from your JSP code. First, you need to create...)
Here is the video tutorial of "How to
connect to
MySQL Database from JSP
How to connect to MySQL from command prompt?How to
connect to
MySQL from command prompt?
This video tutorial walks you through the steps to
connect to
MySQL from command prompt in Windows machine... is installed with the
MySQL server installation and it can be accessed by going
problem connect jsp and mysql - JSP-Servletproblem
connect jsp and mysql hello,
im getting an error while connecting jsp and
mysql.
I have downloaded the driver
mysql-connector... Software Foundation\Tomcat 5.5\common\lib\
mysql-connector-java-2.0.14.jar
unable to connect to server - JSP-Servletunable to
connect to server thank you for the program code...-application-
server/tomcat/install-configure.shtml
Here you will get step by step installation and configuration of Apache Tomcat
Server.
After installation
PHP MySql Server Version ' );//
mysql_
connect(): it open a connection to a
MySql server
//root is the name...PHP
MYSQL server version
Sometimes we need to check the version of
MySql, PHP provides
mysql_get_
server_info() function to check the
MySql version.
To check
how to connect jsp to mysql - Java Beginnershow to
connect jsp to mysql I m new in
Mysql and JSP i m ceating.java file using bean file for connectivity
but i m not able to
connect jsp... me hw to conncet jsp with
mysql
this is connection file
package
connect PHP MySQL Connect to a Database it
with so much ease. To
connect with
mysql server we can use two ways one...
PHP
MySQL Connect to a Database:
... you to check whether your PHP web page has
been connected with
MySQL server why this can'twhy this
can't import java.util.*;
class Dash{
public static void main(String args[]){
int x0=100;
int[] x1=new int[3];
int[][] x2=new int[3][3];
int[][][] x3=new int[3][3][3
How to connect to MySql Database from Servlet?;
font-weight: bold;
}
How to
connect to
MySql Database from Servlet... will show you how to
connect to
MySQL database and perform select operation. You will learn the JDBC steps
necessary to
connect to the
MySQL Database and execute
Check PHP MySQL Connectivity can
connect a PHP page with
MySQL server.ADS_TO_REPLACE_1
Following piece... with
MySQL server or not.
Code 1:
<?phpADS_TO_REPLACE_2
$con=
mysql... not
connect'.
mysql_error());
}
ADS_TO_REPLACE_4
mysql_select_db
MySQL server has gone awayMySQL server has gone away Hi,
What is the reason of error "
MySQL server has gone away"? Some time in my application this error is coming.
Thanks
hi friend,
This happens because the
server is timed out
JSP - MySQL - ConnectionJSP -
MySQL - Connection I
can't connect mysql using jsp in my... from the
server was 1,300,257,595,704 milliseconds ago. The last packet sent successfully to the
server was 0 milliseconds ago. """"
Can you help me
Mysql Permission Mysql Permission
Mysql Permission allows the user to
connect to the database,
Mysql... the permission to
connect. All user /host/password combination are listed in this table