[java ee programming] Tutorial Bundle link - does not work....

2009-03-19 Thread Ronald Ron

hello all,
i just started with the tutorial.  After doing some reading with one
of the materials provided, i happen to bump to one of the links.  It's
a tutorial link - 
http://java.sun.com/javaee/5/docs/tutorial/information/download.html.
I'm suppose to download some examples from the link but it doesn't
work.

Anybody who has the file or alternative link?


Thank you.

RON

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~--~~~~--~~--~--~---



[java ee programming] Re: Lab-1020 Version problem with the JDBCSample

2009-03-19 Thread Don Brumbaugh

Looks like I figured this our.  I just tp right click the project and
resolve to the
.../.netbeans/6.5/config/Database/org_apache_derby_jdbc_ClirntDriver file.

Thanks,
Don



-Original Message-
From: Don Brumbaugh [mailto:debrumba...@verizon.net]
Sent: Thursday, March 19, 2009 10:11 PM
To: Java EE (J2EE) Programming with Passion!
Subject: RE: [java ee programming] Re: Lab-1020 Version problem with the
JDBCSample



I had the same problem and this worked but I have another problem resolution
to resolve.

ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
SQLException: No suitable driver found for
jdbc:derby://localhost:1527/sample

Any ideas how to fix this one?

Thanks,
Don

-Original Message-
From: java-ee-j2ee-programming-with-passion@googlegroups.com
[mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com]on Behalf
Of fredrik
Sent: Monday, March 09, 2009 6:50 PM
To: Java EE (J2EE) Programming with Passion!
Subject: [java ee programming] Re: Lab-1020 Version problem with the
JDBCSample



Yes, I had the same problem.
Right-click the project node and choose Properties.
Select Libraries.
At the top, select JDK 1.6 as Java Platform in the drop-down menu.
This should do it.
/Fredrik

On 8 Mar, 01:01, "supriya khare"  wrote:
> Hi
>
> I have JDK6.0  installed and after downloading the lab1020 and trying to
> open JDBCSample  I get resolve problem: Problem: The project uses the Java
> Platform called "JDK_1.5", but this platform was not found. I have been
> successfully able to work on other labs with JDK6.0.  Also everywhere it
is
> written that we need JDK6.0.  I am not sure whether I have downloaded
wrong
> version of lab... Anybody having similar problem??








--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~--~~~~--~~--~--~---



[java ee programming] Re: Lab-1020 Version problem with the JDBCSample

2009-03-19 Thread Don Brumbaugh

Ok,  I am still getting this error when I compile.

ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
SQLException: No suitable driver found for
jdbc:derby://localhost:1527/sample

Any quesses?


Don

-Original Message-
From: java-ee-j2ee-programming-with-passion@googlegroups.com
[mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com]on Behalf
Of Don Brumbaugh
Sent: Thursday, March 19, 2009 10:11 PM
To: Java EE (J2EE) Programming with Passion!
Subject: [java ee programming] Re: Lab-1020 Version problem with the
JDBCSample




I had the same problem and this worked but I have another problem resolution
to resolve.

ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
SQLException: No suitable driver found for
jdbc:derby://localhost:1527/sample

Any ideas how to fix this one?

Thanks,
Don

-Original Message-
From: java-ee-j2ee-programming-with-passion@googlegroups.com
[mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com]on Behalf
Of fredrik
Sent: Monday, March 09, 2009 6:50 PM
To: Java EE (J2EE) Programming with Passion!
Subject: [java ee programming] Re: Lab-1020 Version problem with the
JDBCSample



Yes, I had the same problem.
Right-click the project node and choose Properties.
Select Libraries.
At the top, select JDK 1.6 as Java Platform in the drop-down menu.
This should do it.
/Fredrik

On 8 Mar, 01:01, "supriya khare"  wrote:
> Hi
>
> I have JDK6.0  installed and after downloading the lab1020 and trying to
> open JDBCSample  I get resolve problem: Problem: The project uses the Java
> Platform called "JDK_1.5", but this platform was not found. I have been
> successfully able to work on other labs with JDK6.0.  Also everywhere it
is
> written that we need JDK6.0.  I am not sure whether I have downloaded
wrong
> version of lab... Anybody having similar problem??












--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~--~~~~--~~--~--~---



[java ee programming] Unsubscribe

2009-03-19 Thread Zion Lavie




  
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~--~~~~--~~--~--~---



[java ee programming] Re: Lab-1020 Version problem with the JDBCSample

2009-03-19 Thread Don Brumbaugh


I had the same problem and this worked but I have another problem resolution
to resolve.

ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
SQLException: No suitable driver found for
jdbc:derby://localhost:1527/sample

Any ideas how to fix this one?

Thanks,
Don

-Original Message-
From: java-ee-j2ee-programming-with-passion@googlegroups.com
[mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com]on Behalf
Of fredrik
Sent: Monday, March 09, 2009 6:50 PM
To: Java EE (J2EE) Programming with Passion!
Subject: [java ee programming] Re: Lab-1020 Version problem with the
JDBCSample



Yes, I had the same problem.
Right-click the project node and choose Properties.
Select Libraries.
At the top, select JDK 1.6 as Java Platform in the drop-down menu.
This should do it.
/Fredrik

On 8 Mar, 01:01, "supriya khare"  wrote:
> Hi
>
> I have JDK6.0  installed and after downloading the lab1020 and trying to
> open JDBCSample  I get resolve problem: Problem: The project uses the Java
> Platform called "JDK_1.5", but this platform was not found. I have been
> successfully able to work on other labs with JDK6.0.  Also everywhere it
is
> written that we need JDK6.0.  I am not sure whether I have downloaded
wrong
> version of lab... Anybody having similar problem??








--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~--~~~~--~~--~--~---



[java ee programming] Not Homework?

2009-03-19 Thread lisandrodc

Hi! The following link: http://www.netbeans.org/kb/50/tutorial-taglibrary.html,
for make homework from "JSP 1.2 Custom Tags - We are not covering this
topic in this course" ¿Do not it have homework?
Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~--~~~~--~~--~--~---



[java ee programming] Re: Lab 1020. Javadoc does not work

2009-03-19 Thread Priyanka Bhardwaj
Thanks. I have the C:\Program Files\Java\jdk1.6.0_03\src.zip as the javadoc
file and I have java 1.6 as default. But I still cannot see the javadoc for
Connection or DriverManager or anything. I am using windows. Any ideas would
be appreciated.

Priya

On Tue, Mar 17, 2009 at 10:44 PM, SureshReddy wrote:

> you need to add the zip file of javadoc to the java platform manager but
> not see anyway if you want to see the javadoc first extract the zip  you are
> not mentioned which JDK version you are currently using if JDK6.0 or any
> update of version 6.0 you see the zip file here if the platform is Windows
> C:\Program Files\Java\jdk1.6.0_10\src.zip
>
>
>   On Wed, Mar 18, 2009 at 9:09 AM, Priyanka Bhardwaj <
> priyankab...@gmail.com> wrote:
>
>>  Hi all,
>>
>> As mentioned in the Lab document, I tried to see the javadoc for
>> "Statement". But I get a tiny message in the bottom left corner of netbeans
>> IDE telling that "cannot perform show javadoc here". Does anybody know why I
>> might be getting this message instead of the browser being opened? However,
>> Show Javadoc properly shows the javadoc for HttpServlet from hello2 project
>> in a browser.
>>
>> Thanks a lot,
>>
>> Priyanka
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~--~~~~--~~--~--~---



[java ee programming] Re: unclear new Object declaration

2009-03-19 Thread Lars Hermes

Hello,

to answer your question: NO it is not the same! In the first case you you only 
declare a variable of type Manager which has no reference to an object (i.e. 
null). In the second case you also create an object of type Manager and you 
immediately assign a reference to a newly created object of type Manager (i.e. 
new Manager()). If you set the reference of the variable manager to null 
afterwards, you throw the newly created object away and it will be cleared up 
by the GC. Maybe you'll take a look in the Standard Java programming course of 
Javapassion to gain a deeper understanding of OO.

Cheers
Lars 


I am trying to discern another programmer's code (good luck I know)

In a class that tests connectivity to a datasource, the first line
after the try { opening up is a statement that I am not clear on.

it is like this
import model.Manager;
public class DataSourceConnectionObject {
public static void main(String[] args) {
try {
Manager manager = "null";

is this setting a new object of Manager named "manager" and setting it
to null ?
it this the same as if manager = new Manager and set manager =null on
second line?

just making sure its not doing something else...
thx


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~--~~~~--~~--~--~---



[java ee programming] Re: please tell the solution urgently

2009-03-19 Thread Manjula Srinivas
Please reply to the group so that the person how asked gets the answer
to his/her questions

On Thu, Mar 19, 2009 at 12:53 AM, Chandra Bhanu Verma
 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 
> 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  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"%>
>> > �� "http://www.w3.org/TR/html4/loose.dtd";>
>>
>> 
>> ��� 
>> ��� 
>> ��� JSP Page
>> ��� 
>> ��� 
>> ��� 
>>
>> ���  user name: 
>> ��� 
>> ��� 
>> ���  password: 
>> ��� 
>> � 
>>  
>> ��� 
>> ��� 
>> ��� 
>> 
>>
>>
>> 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);
>> ��� pw.print("con complete");
>>
>> ��� Statement stmt=con.createStatement();
>> ��� Resul

[java ee programming] Re: please tell the solution urgently

2009-03-19 Thread Manjula Srinivas
Please reply to the group.

On Wed, Mar 18, 2009 at 9:15 AM, Sameer Kumar Muvva
 wrote:
> Check to see whether you have added the appropraite driver in the libraries
> of the project. You can check whether the driver is added or not using the
> following
> type com and then dot, then see if you are finding mysql. If you find it
> then there is no problem with driver.
>
> If there is a pblm, then click on libraries and add the appropriate .jar
> file of mysql.
>
> On Tue, Mar 17, 2009 at 1:28 PM, Manjula Srinivas 
> 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  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"%>
>> > > > �� "http://www.w3.org/TR/html4/loose.dtd";>
>> >
>> > 
>> > ��� 
>> > ��� 
>> > ��� JSP Page
>> > ��� 
>> > ��� 
>> > ��� 
>> >
>> > ���  user name: 
>> > ��� 
>> > ��� 
>> > ���  password: 
>> > ��� 
>> > � 
>> >  
>> > ��� 
>> > ��� 
>> > ��� 
>> > 
>> >
>> >
>> > 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);
>> > ��� pw.print("con complete");
>> >
>> > ��� Statement stmt=con.createStatement();
>> > ��� ResultSet rs=stmt.executeQuery("select * from mydb.login;");
>> >
>> > ��� pw.println("");
>> > ��� pw.print("");
>> > ��� pw.print(""+"output stopped"+"");
>> > ��� pw.print(""+"user name is "+str1+"");
>> > ��� pw.println("password is"+str2+"");
>> > ��� pw.println(""+"this is servlet output");
>> > ��� pw.print("this is database");
>> > ��� while(rs.next())
>> > ��� {
>> > ��� pw.print(rs.getString(1)+"");
>> > ��� pw.print(rs.getString(2)+"");
>> >
>> > ��� }
>> > ��� pw.println(" ");
>> > ��� pw.println("");
>> > ��� }
>> > ��� catch(Exception e)
>> > ��� {
>> > ��� System.out.print("error occured");
>> > ��� }
>> > ��� }
>> >
>> > ��� @Override
>> > ��� protected void doPost(HttpServletRequest request,
>> > HttpServletResponse
>> > response)
>> > ��� throws ServletException, IOException {
>> > ��� //processRequest(request, response);
>> > ��� }
>> >
>> > ��� @Override
>> > ��� public String getServletInfo() {
>> > ��� return "Short description";
>> > ��� }// 
>> >
>> > }
>> >
>> > >
>> >
>>
>> >>
>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email

Fwd: [java ee programming] Re: please tell the solution urgently

2009-03-19 Thread Manjula Srinivas
Again please reply to the group, so that the person who asked the
question gets the answer to his/ her questions.


-- Forwarded message --
From: Sameer Kumar Muvva 
Date: Wed, Mar 18, 2009 at 9:15 AM
Subject: Re: [java ee programming] Re: please tell the solution urgently
To: talk2manj...@gmail.com


Check to see whether you have added the appropraite driver in the
libraries of the project. You can check whether the driver is added or
not using the following
type com and then dot, then see if you are finding mysql. If you find
it then there is no problem with driver.

If there is a pblm, then click on libraries and add the appropriate
.jar file of mysql.

On Tue, Mar 17, 2009 at 1:28 PM, Manjula Srinivas
 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  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"%>
> >  > �� "http://www.w3.org/TR/html4/loose.dtd";>
> >
> > 
> > ��� 
> > ��� 
> > ��� JSP Page
> > ��� 
> > ��� 
> > ��� 
> >
> > ���  user name: 
> > ��� 
> > ��� 
> > ���  password: 
> > ��� 
> > � 
> >  
> > ��� 
> > ��� 
> > ��� 
> > 
> >
> >
> > 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);
> > ��� pw.print("con complete");
> >
> > ��� Statement stmt=con.createStatement();
> > ��� ResultSet rs=stmt.executeQuery("select * from mydb.login;");
> >
> > ��� pw.println("");
> > ��� pw.print("");
> > ��� pw.print(""+"output stopped"+"");
> > ��� pw.print(""+"user name is "+str1+"");
> > ��� pw.println("password is"+str2+"");
> > ��� pw.println(""+"this is servlet output");
> > ��� pw.print("this is database");
> > ��� while(rs.next())
> > ��� {
> > ��� pw.print(rs.getString(1)+"");
> > ��� pw.print(rs.getString(2)+"");
> >
> > ��� }
> > ��� pw.println(" ");
> > ��� pw.println("");
> > ��� }
> > ��� catch(Exception e)
> > ��� {
> > ��� System.out.print("error occured");
> > ��� }
> > ��� }
> >
> > ��� @Override
> > ��� protected void doPost(HttpServletRequest request, HttpServletResponse
> > response)
> > ��� throws ServletException, IOException {
> > ��� //processRequest(request, response);
> > ��� }
> >
> > ��� @Override
> > ��� public String getServletInfo() {
> > ��� return "Short description";
> > ��� }// 
> >
> > }
> >
> > >
> >
>
> >

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To uns

Fwd: [java ee programming] Re: please tell the solution urgently

2009-03-19 Thread Manjula Srinivas
While replying click on "Reply All"so  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
 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 
> 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  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"%>
>> > �� "http://www.w3.org/TR/html4/loose.dtd";>
>>
>> 
>> ��� 
>> ��� 
>> ��� JSP Page
>> ��� 
>> ��� 
>> ��� 
>>
>> ���  user name: 
>> ��� 
>> ��� 
>> ���  password: 
>> ��� 
>> � 
>>  
>> ��� 
>> ��� 
>> ��� 
>> 
>>
>>
>> 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);
>> ��� pw.print("con complete");
>>
>> ��� Statement stmt=con.createStatement();
>> �