and here is my original SQLSelect.java file which is responsible with the
database connection
it works on unix server with java1.2
but doesn't work with tomcat neither on campus server nor on my PC  with
Tomcat.3.2.1
import java.io.*;
import java.sql.*;
import java.net.URL;
import java.util.*;

final class SQLSelect {
  static private int recordCount,fieldCount;
  static private String fieldsName[];

  static private Connection con  = null;
  static private String myUID      = "xx";
  static private String myPassword = "yy";

  public static Connection getCon()  { return con; }

  public static void connectDatabase(boolean reConnect) {

    String connURL =
"jdbc:informix-sqli://dbs.cc.ntut.edu.tw:5000/cbh:informixserver=online7;use
r=xx;password=yy";
     /*user and password not shown here on the mail for security*/

    try {
          String ifxDriver = "com.informix.jdbc.IfxDriver";

          // Register the INFORMIX-JDBC driver
          Driver IfmxDrv = (Driver) Class.forName(ifxDriver).newInstance();

          if ((con == null) || (reConnect)) {
            // Get a connection to the database server
            con = DriverManager.getConnection(connURL);

          return;}
    } catch (Exception e) {

     System.out.println("<wml><card id=\"hata1\"
title=\"baglantihatasi\"><p>Could not connect error"+e.getMessage()+"<do
type='accept' label='back'><prev/></do></p></card></wml>");
       return;
    }
  } // End of connectDatabase(...)

  public static void closeConnection() {
    try {
          if (con  != null) con.close();
          con  = null;
    } catch (Exception e){

     System.out.println("<wml><card id='noClose'
title='notClosed'><p>error:<br>can not close<br>database
connection</p></card></wml>");
    }
  }  // End of public static void closeAll(int showMessageType) {
} // End of class sqlSelect {



----- Original Message -----
From: "Andy C" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 08, 2001 6:21 PM
Subject: Re: Strange SQL exception problem


> Hang on,
> is this the central database server on the campus?  Are you sure you
> have a user name and password to connect to that database ?
>
> Andy
>
> ----- Original Message -----
> From: "yilmaz" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, July 08, 2001 11:07 AM
> Subject: Re: Strange SQL exception problem
>
>
> > Hi Andy,
> > at least i know that our campus database is Informix online7 , and the
> > driver i am using is of
> > the same version  as the database itself.
> > it seems that it has something to do with the jdk incompatibility,
> > and i couldn't find a workaround for this problem
> > thanks again
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to