While replying click on Reply Allso that it is respond to the
group I did not ask this question.
On Thu, Mar 19, 2009 at 12:53 AM, Chandra Bhanu Verma
chandrabhanu.ve...@utitsl.co.in wrote:
Hello dear friend,
Correct following things in give code:
Before changing in code you have to do following steps to check mySQL
library file added or not :
Go to property of project and cilck on library whether jar file
“mysql-connector-java-3.1.11-bin.jar” added or not if not then first
attached that.
Then check code for following changes.
1. Class.forName(com.mysql.jdbc.Driver).newInstance();
2. Connection con=
DriverManager.getConnection(jdbc:mysql://localhost:3306/mydb,userid,pass);
Check with above steps.
From: java-ee-j2ee-programming-with-passion@googlegroups.com
[mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com] On Behalf Of
Fernando Abreu
Sent: Wednesday, March 18, 2009 9:56 PM
To: talk2manj...@gmail.com
Cc: fiveholida...@hotmail.com; kiran.billap...@gmail.com;
java-ee-j2ee-programming-with-passion@googlegroups.com; kiran. b333
Subject: [java ee programming] Re: please tell the solution urgently
I don't know if it is the major problem but check on your code :
try{
pw.println(entered try);
Class.forName(com.mysql.jdbc.Driver);
pw.println(enter for name);
pw.print(url);
String durl=jdbc:mysql://localhost:3306/mydb?;
String userid=root;
String pass=root;
Connection con=DriverManager.getConnection(durl, userid, pass);
pw.print(con complete);
What happens if you change to:
String durl=jdbc:mysql://localhost:3306/mydb/;
or
String durl=jdbc:mysql://localhost:3306/mydb;
It does not sound a great solution, but I got stuck in a / (forward
slash) I forgot in an application in the past, and that drove me nuts.
Fernando
On Tue, Mar 17, 2009 at 2:28 PM, Manjula Srinivas talk2manj...@gmail.com
wrote:
Even I agree with Evans reply, Kiran please check whether the driver
is configured properly.
On Tue, Mar 17, 2009 at 11:25 AM, Evans fiveholida...@hotmail.com wrote:
Thanks for telling us about your problem. But what you didn't tell us
however,�was the error message.
Anyway, make sure you have the driver installed before you can use it. But
if you think you have it installed but still not able to run your code, it
might help by posting the error message you received.
Good luck
--
Evans
http://www.javawug.org
- Original Message -
From: Kiran Kumar
To: java-ee-j2ee-programming-with-passion@googlegroups.com ; kiran. b333
Sent: Tuesday, March 17, 2009 5:30 PM
Subject: [java ee programming] please tell the solution urgently
hi,
�i have created jsp login page and servlet(with database connection) in
netbeans 6.5. in servlet file i specified
Class.forname(com.mysql.jdbc.Driver). whenever i click submit button, this
servlet has to be executed. but the above command is not executed. unless
it
executes, i cannot work with database. so please find out the error in it.
DUE TO THIS ERROR MY ACADAMIC PROJECT WAS STOPPED.PLEASE HELP ME.
��� THANK U IN ADVANCE
JSP FILE
%...@page contentType=text/html pageEncoding=UTF-8%
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
�� http://www.w3.org/TR/html4/loose.dtd;
html
��� head
��� meta http-equiv=Content-Type content=text/html;
charset=UTF-8
��� titleJSP Page/title
��� /head
��� bodyform action=servlet2 method=get
��� center
��� label for=name user name: /label
��� input type=text value= name=username
��� br
��� label for=PASSWORD password: /label
��� input type=text value= name=password
� br
input type=submit value=submit
��� /center
��� /form
��� /body
/html
SERVLET
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class servlet2 extends HttpServlet {
��� @Override
��� protected void doGet(HttpServletRequest request, HttpServletResponse
response)
�throws ServletException, IOException{
��� String str1=request.getParameter(username);
��� String str2=request.getParameter(password);
�� PrintWriter pw=response.getWriter();
��� response.setContentType(text/html);
��� pw.println(enter try);
��� try{
�� pw.println(entered try);
�� Class.forName(com.mysql.jdbc.Driver);
�� pw.println(enter for name);
�� pw.print(url);
� String durl=jdbc:mysql://localhost:3306/mydb?;
String userid=root;
String pass=root;
Connection con=DriverManager.getConnection(durl, userid, pass);