For "d:\WebSphere\Studio\check_out\Jvcpro\connect_jsp_1.java:82: Undefined
variable or class name: con", I think you need to define "con" in
"connection = DriverManager.getConnection(url, username, password);" by
adding "con" in "connection con = DriverManager.getConnection(url, username,
password);".
Hope this help.
Ting
> -----Original Message-----
> From: A mailing list about Java Server Pages specification
> and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of sumit shah
> Sent: Wednesday, August 23, 2000 9:37 AM
> To: [EMAIL PROTECTED]
> Subject: please help
>
>
> hi all,
> After changing the drivers and all i am now getting the
> following errors.
> I am pasting the code snippet and also the errors. I think the code is
> unable to find all the java classes but i have already
> installed jdk 1.1.7
>
> code snippet:
> Connection connection;
> try {
> Class.forName("com.ibm.db2.jdbc.app.DB2Driver ");
> String url = "jdbc:db2:JVCLIVE";
> String username = "DB2ADMIN";
> String password = "frisky";
> connection = DriverManager.getConnection(url,
> username, password);
> Statement stmt = con.createStatement();
> String query="SELECT
> DB2ADMIN.CATEGORY.CATEGORY_ID,DB2ADMIN.CATEGORY.CATEGORY_NAME FROM
> DB2ADMIN.CATEGORY";
> ResultSet RS=stmt.executeQuery(query);
>
> while(RS.next())
> out.println("RS(1)");
> RS.close();
> con.close();
> }
> catch (ClassNotFoundException e) {
> out.println("Could not load database driver!");}
> catch (SQLException e) {
> out.println("Could not connect to the database!");}
>
> %>
>
>
> The error statement are:
> d:\WebSphere\Studio\check_out\Jvcpro\connect_jsp_1.java:75:
> Class d_0003a.WebSphere.Studio.check_0005fout.Jvcpro.Connection not
> found in type declaration.
> ^
> d:\WebSphere\Studio\check_out\Jvcpro\connect_jsp_1.java:81: Undefined
> variable or class name: DriverManager
> ^
> d:\WebSphere\Studio\check_out\Jvcpro\connect_jsp_1.java:82: Class
> d_0003a.WebSphere.Studio.check_0005fout.Jvcpro.Statement not
> found in type
> declaration.
> ^
> d:\WebSphere\Studio\check_out\Jvcpro\connect_jsp_1.java:82: Undefined
> variable or class name: con
> ^
> d:\WebSphere\Studio\check_out\Jvcpro\connect_jsp_1.java:84: Class
> d_0003a.WebSphere.Studio.check_0005fout.Jvcpro.ResultSet not
> found in type
> declaration.
> ^
>
>
> please help.
> ______________________________________________________________
> __________
> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets