thanks.  did that.  didn't help.  The system worked fine as long as I used
MS SQL and the Microsoft driver, which is registered internally as matching
the adaptor MSSQL.  A quick study of DBFactory.class has convinced me there
is no easy way to switch drivers outside of the default list:

DBFactory.java:

    /**
     * Initialize the JDBC driver to Torque Adapter map.
     */
    private static void initializeDriverToAdapterMap()
    {
        driverToAdapterMap = new Hashtable();
        driverToAdapterMap.put("com.ibm.as400.access.AS400JDBCDriver",
"DBDB2400");
        driverToAdapterMap.put("COM.ibm.db2.jdbc.app.DB2Driver",
"DBDB2App");
        driverToAdapterMap.put("COM.ibm.db2.jdbc.net.DB2Driver",
"DBDB2Net");
        driverToAdapterMap.put("COM.cloudscape.core.JDBCDriver",
"DBCloudscape");
        driverToAdapterMap.put("org.hsql.jdbcDriver", "DBHypersonicSQL");
        driverToAdapterMap.put("interbase.interclient.Driver",
"DBInterbase");
        driverToAdapterMap.put("org.enhydra.instantdb.jdbc.idbDriver",
"DBInstantDB");

driverToAdapterMap.put("com.microsoft.jdbc.sqlserver.SQLServerDriver",
"DBMSSQL");
        driverToAdapterMap.put("org.gjt.mm.mysql.Driver", "DBMM");
        driverToAdapterMap.put("oracle.jdbc.driver.OracleDriver",
"DBOracle");
        driverToAdapterMap.put("org.postgresql.Driver", "DBPostgres");
        driverToAdapterMap.put("com.sap.dbtech.jdbc.DriverSapDB",
"DBSapDB");
        driverToAdapterMap.put("com.sybase.jdbc.SybDriver", "DBSybase");
        driverToAdapterMap.put("com.sybase.jdbc2.jdbc.SybDriver",
"DBSybase");
        driverToAdapterMap.put("weblogic.jdbc.pool.Driver", "DBWeblogic");
}

Using a driver outside of this list results in the message "Unknown JDBC
driver" and a Torque exception.  (This is different than Turbine coupled
Torque, which let this mapping be set in the properties file).  This seems a
blow to the database-independent spirit of Torque.

Did I miss anything here?  Any quick way of getting around this?


Thanks, WILL

-----Original Message-----
From: Nicholas Wheeler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 1:56 PM
To: Turbine Torque Users List
Subject: Re: registering a new JDBC driver


I am not sure of the differences between the coupled and the de-coupled
since I have only ever used the de-coupled version of Torque. But, for
running an application using torque use the Torque.properties file:

here is part of mine for using MySQL:

# -------------------------------------------------------------------
#
#  T O R Q U E  P R O P E R T I E S
#
# -------------------------------------------------------------------
# These are your database settings. Look in the
# org.apache.torque.pool.* packages for more information.
#
# The parameters to connect to the default database.  You MUST
# configure these properly.
# -------------------------------------------------------------------

torque.database.default=my_db

torque.database.my_db.driver = org.gjt.mm.mysql.Driver
torque.database.my_db.url = jdbc:mysql://127.0.0.1/my_db
torque.database.my_db.username = username
torque.database.my_db.password = *******



At 01:20 PM 4/30/2002 -0700, you wrote:
>Hi,
>
>If I want to use a new JDBC driver, how do I register it in the properties
>file?  In the coupled Turbine, I did this:
>
>database.adaptor.DBMSSQL=com.jnetdirect.jsql.JSQLDriver
>
>But I can't figure out how to do it with stand-alone Torque.  Apparently
the
>Microsoft JDBC driver is the default.  But if I use a different one i get
>this error:
>
>org.apache.torque.TorqueException: Unknown JDBC driver:
>com.jnetdirect.jsql.JSQLDriver: Check your configuration file
>
>Thanks, WILL
>_______________________________________
>Forio Business Simulations
>Will Glass-Husain
>(415) 440-7500 phone
>(415) 235-4293 mobile
>[EMAIL PROTECTED]
>www.forio.com
>
>
>--
>To unsubscribe,
>e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>


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

Reply via email to