cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <wallez.anyw...@free.fr>
Subject Re: Help for Cocoon 1.8 & MS. Access database!!!
Date Tue, 17 Oct 2000 15:16:40 GMT
You cannot add a driver in Turbine that way !

The database name (DBSybase, DBOracle, etc) are used by Turbine to build
a class name. If that class does not exist, you cannot create
connections.

First of all, note that the ODBC driver exists in Turbine but is not
included in turbine-pool.jar. The main reason for that is that the
JDBC-ODBC bridge is not suitable for heavily multi-threaded environments
like a web server.

However, I once needed to use an Access database from Cocoon and I did a
trick to fool Turbine : select a database type that you do not use and
change its driver class to the JDBC-ODBC bridge.
Example :
processor.xsp.pool.database.adaptor.DBInformix=sun.jdbc.odbc.JdbcOdbcDriver

Now, Turbine thinks that the ODBC driver is an Informix database. Some
turbine features will not work properly, but they are not used in
Cocoon.

Note that the name of the pool has no relation to the type of the
database. You can keep "DBODBC" as your pool name.

Hope this helps, but remember : Access is not good for a webserver
back-end.

-Sylvain

> beichuang a écrit :
> 
> Hello, all:
> 
> I am not sure whether cocoon 1.8 (Turbine engine) can work with MS
> Access databbase? Anyway, I did the stpes following:
> 
> 1. add a new database driver into cocoon.properties file:
> 
> # These properties are used by the DBFactory.
> 
> processor.xsp.pool.database.adaptor=DBWeblogic,DBOracle,DBInstantDB,DBPostgres,DBSybase,DBInformix,DBODBC
> processor.xsp.pool.database.adaptor.DBWeblogic=weblogic.jdbc.pool.Driver
> processor.xsp.pool.database.adaptor.DBOracle=oracle.jdbc.driver.OracleDriver
> processor.xsp.pool.database.adaptor.DBInstantDB=org.enhydra.instantdb.jdbc.idbDriver
> processor.xsp.pool.database.adaptor.DBPostgres=postgresql.Driver
> processor.xsp.pool.database.adaptor.DBInformix=com.informix.jdbc.IfxDriver
> processor.xsp.pool.database.adaptor.DBSybase=com.sybase.jdbc.SybDriver
> 
> # ODBC driver added
> 
> processor.xsp.pool.database.adaptor.DBODBC=sun.jdbc.odbc.JdbcOdbcDriver
> processor.xsp.pool.database.DBODBC.url=jdbc:odbc:MyDBTest
> processor.xsp.pool.database.DBODBC.username=dbUser
> processor.xsp.pool.database.DBODBC.password=dbPass
> processor.xsp.pool.database.DBODBC.maxConnections=3
> processor.xsp.pool.database.DBODBC.expiryTime=3600000
> 
> 2. compose a xsp file below:
> 
> <?cocoon-process type="xsp"?>
> <?xml-logicsheet
> href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
> <?cocoon-process type="xslt"?>
> 
> <xsp:page language="java" create-session="true"
>           xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>           xmlns:sql="http://www.apache.org/1999/SQL"
>           xmlns:request="http://www.apache.org/1999/XSP/Request">
> 
>   <page title="SQL Search Results">
> 
>   <sql:execute-query>
>             <sql:use-connection>DBODBC</sql:use-connection>
>             <sql:skip-rows>0</sql:skip-rows>
>             <sql:max-rows>50</sql:max-rows>
>             <sql:null-indicator>y</sql:null-indicator>
>             <sql:count-attribute>BOB</sql:count-attribute>
>             <sql:doc-element>ROWSET</sql:doc-element>
>             <sql:row-element>ROW</sql:row-element>
>             <sql:tag-case>preserve</sql:tag-case>
>             <sql:id-attribute>ID</sql:id-attribute>
>             <sql:query>
>                SELECT * FROM tabell1
>            </sql:query>
>         </sql:execute-query>
> 
>  </page>
> 
> </xsp:page>
> 
> 3. then when I use IE browser to access the file, the error message
> shows:
> 
>                    Error found handling the request.
> 
> java.lang.NullPointerException
>  at
> org.apache.cocoon.processor.xsp.library.sql.XSPSQLLibrary.processQuery(XSPSQLLibrary.java,
> Compiled Code)

<snip/>

Mime
View raw message