tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Yonglin Li)
Subject JDBC
Date Tue, 04 Sep 2001 03:45:44 GMT
Hi, experts!
    I met a problem when I tried to make JDBC connection by using the
code as follows.

    The program work well when I use startup.bat to start tomcat.

    But I cannot use it when I start Tomcat as a service. Yet I can
still use all the other JSP sameples, it tells me the URL is not valid
or does not exist. I promise the ODBC data source is there and I can use
it when I start tomcat using Startup.bat
So can some body tell me the reason.


public class PersistentConnection {

    private static Connection theConnection;
    public static Connection getConnection() {return theConnection;}

    public void setDbClass() {
        try {

        } catch (Exception e) {
            System.err.println("Error loading class");

    public void setConnection() {
        try {
            theConnection =

        }catch (Exception e) {
            System.err.println("Error setting DBUrl");

  public void shutDown() {
    try {
    } catch (Exception e) {}

View raw message