I am trying to use Turbine with TomCat4.04 to provide connection pooling
to a MS-SQL 7 DB.  Turbine appears to be loading correctly; I see the
"Ready to Rumble!" message in the console when I start up - 

However, when I try to get a connection to the DB, the connection object
appears to be valid, but I get a NullPointerException when I try to
access it to get a statement or preparedstatement object.

Here is the code in my JSP:

<%
    System.out.println("Creating the connection");
    DBConnection conn= TurbineDB.getConnection();
    System.out.println("Connection:" + conn.toString());
    System.out.println("Creating the statement...");
    Statement stmt= conn.createStatement();
    System.out.println("Executing the query");
    ResultSet rs= stmt.executeQuery("select * from locidata");

    if( rs.next() ){
      out.println("Result Set Found!");
    }else{
      out.println("Result not found.");
    }

    rs.close();
    stmt.close();
    TurbineDB.releaseConnection(conn);

  }catch( Exception e ){
    e.printStackTrace();
  }
%>

I am trying to use the sun JDBC-ODBC driver -- here is what my
Turbine.properties file looks like:

# -------------------------------------------------------------------
#
#  D A T A B A S E  S E T T I N G S
#
# -------------------------------------------------------------------
# These are your database settings.  Look in the
# org.apache.turbine.util.db.pool.* packages for more information.
# The default driver for Turbine is for MySQL.
#
# The parameters to connect to the default database.  You MUST
# configure these properly.
# -------------------------------------------------------------------

databaseUrl = jdbc:odbc:Loci
databaseHost = localhost
databaseDriver = sun.jdbc.odbc.JdbcOdbcDriver
databaseUser = LociUser
databasePassword = master


Any help would be greatly appreciated!

Michael Griffith





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to