I am assuming that the Informix JDBC driver will not work with an older
version of the jdk. Check to see which jdk your path is pointing to by
typing in
%which java

You might have multiple versions of jdk installed on your server and your
path might reflect an older version. When you modify your path info, make
sure the path to jdk1.2.1 comes before the path to any previous versions (or
just remove any old references altogether).

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Thang Nguyen
Sent: Wednesday, October 25, 2000 7:46 PM
To: [EMAIL PROTECTED]
Subject: Re: JSP with Informix JDBC


ok,  I just found one more thing and i think it is related to my problem.
When I run the stand
alone java from the command line I need to put in the version which 1.2.1
for it to work with JDBC
such as:

% java -Djava.vm.version=1.2.1  TestDB
'jdbc:informix-sqli://143.183.67.14:1529/test31:INFORMIXSERVER=tng93;user=in
fotest;password=i5u'


I guess I need to do the same thing for JSP which is to specify the version
number, but how can I do
this?
Can you pls let me know?  Thanks

-Thang






Thang Nguyen wrote:

> Hi,
>
> I had a problem to get this jsp page to work (basically, it can not
establish the
> connection to the Informix database).  However, if I write a stand alone
java
> module  with the same driver and URL as described below, then it worked
just fine.
> There seemed to be a problem if I tried to do this within JSP.    My
webserver is
> Tomcat (stand alone) and it worked fine except when it tried to connect to
the
> database.   I can assure with you that the driverName and dbUrl are
correct, I
> checked them so many times.    The code  can only execute up to the line
of
> "Testing2... ha ha ha".     The error I got is simply said that it could
not
> connect to the database.    Do you see what I have done wrong? please
suggest a way
> for me to debug.  Below is my JSP page.  Thanks much in advance.
>
> <%@ page import="java.sql.*" %>
>
> <html>
> <body>
>
> <%
>       String driverName = "com.informix.jdbc.IfxDriver";
>       String dbUrl =
>
"jdbc:informix-sqli://143.183.67.14:1529/test31:INFORMIXSERVER=tng93;user=in
fotest;password=i5u";
>
>       out.println("<br>" + "Testing1...h ha ha ha");
>       try {
>          // Step 1.  Load the driver
>          Class.forName(driverName);
>
>          out.println("<br>" + "Testing2...h ha ha ha");
>          // Step 2:  Get a connection
>          out.println(dbUrl);
>          Connection myConn = DriverManager.getConnection (dbUrl);
>          out.println("<br>" + "Testing3...h ha ha ha");
>
>          // Step 3:  Create and execute the SQL statement
>          Statement myStmt = myConn.createStatement ();
>          ResultSet myRs = myStmt.executeQuery ("SELECT * from pdscddata");
>          out.println("<br>" + "Testing4...h ha ha ha");
>
>          // Step 4:  Process the Result Set
>          while (myRs.next()) {
>             out.println("<br>" + myRs.getString ("pdsname"));
>          }
>       }
>       catch (SQLException exc) {
>          out.println("<br> ERROR: failed to connect !");
>          exc.printStackTrace();
>       }
>       catch (ClassNotFoundException exc) {
>          out.println("<br> ERROR: failed to find a class !");
>          exc.printStackTrace();
>       }
> %>
>
> </body>
> </html>
>
>
===========================================================================
> 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

===========================================================================
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

Reply via email to