Hi Brad,
first thank  you for your reply.
you say JDBC is not properly set up.
can you explain why does grade.class which is almost same check.class works
in     wapteam/public_html/cgi-bin/java/
       but doesn't work in
       /wapteam/tomcat/webapps/ROOT/WEB-INF/classes
i tried the same thing from tomcat server engine which is installed in my
PC.
it gave the following error message (or exception):

<?xml version="1.0" encoding="big5"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD
/wml_1.1.xml">
<wml><card id="login" title="Your Scores">
<wml><card id="problem" title="connection problem"><p>Could not connect
errorcom.infor
mix.jdbc.IfxDriver<do type='accept'
label='back'><prev/></do></p></card></wml>
<wml><card="noCon" title="no Connect"><p>Couldnotconnected to database
server<do
 type='accept' label='back'><prev/></do></p></card></wml>
<p>some chinese error message here<br/>
????�s???J<br/>
<anchor><go
href="http://dbs.cc.ntut.edu.tw/wapteam/score.wml"/>Back</anchor><
/p></card></wml>

i suspect something wrong with the authorization related with directories
Am i right?
can someone please help me with this?
at the bottom is the SQLselect.java file for your reference:
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      = "dbquery";
  static private String myPassword = "stop0610";

  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=xxxxxx;password=yyyyy";
    file://the URL to be used for establishing the JDBC connection *

    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=\"connection
problem\"><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: "Brad Cox" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 05, 2001 2:05 AM
Subject: Re: database connection from a servlet can't succeed


> At 11:49 PM +0800 7/4/01, yilmaz wrote:
>
> Sounds like JDBC isn't being set up properly. Try downloading
> http://virtualschool.edu/jwaa and examining the demo application
> that's provided there.
>
> >Hi All,
> >i had a java class which used to make a database query, and a CGI file to
> >handle requests.
> >now i replaced these two with a servlet with the same functions
> >when i compiled my servlet, it was fine.
> >however, when i access it through a browser (WAP browser) it gives me
can't
> >connect to the database exception. My files are on a Unix server. I am
> >authorized to use wapteam directory which is at :
> >/user/staff/wapteam/.....
> >my servlet engine (tomcat 3.2.1) is at  /wapteam/tomcat
> >and my servlet "check" is at  tomcat/webapps/ROOT/WEB-INF/classes
> >my check servlet uses Student, SemScore,Score,SQLSelect classes, and i
put
> >all of them
> >in the same directory as check.class.
> >where am i wrong?
> >the aplication gives me the SQLexception so i think, it can find those
java
> >classes
> >however, it can't establish database connection.
> >without servlets it works fine.
> >previously i had a grade.class which is almost same as the check.class
> >except that it was not a servlet.
> >and all these classes were staying at
> >wapteam/public_html/cgi-bin/java/
> >it is still working under this directory.
> >Do i need to install tomcat inside cgi-bin directory in order to be able
to
> >access the database.
> >(By the way all these Student, SemScore,Score,SQLSelect classes are same
for
> >both cases.)
> >thanks in advance.
> >hope i am not off topic. :)
> >if  I am, forgive me..
> >
> >
> >>
> >>
>
>___________________________________________________________________________
> >>  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
>
>
> --
> ---
> For industrial age goods there were checks and credit cards.
> For everything else there is mybank.dom at http://virtualschool.edu/mybank
> Brad Cox, PhD; [EMAIL PROTECTED] 703 361 4751
>
>
___________________________________________________________________________
> 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