Hello,

I changed the database of my Jetspeed based application from a PostgreSQL
database to a MS SQL Server 2000 database.
It went fine so far after some tries. I'm able to login, view values stored
in the database and even are able to clear the database
by the application.

The problem is that I can't write into the database. I'm using Torque
generated classes for db access.
When calling the save() method of such a class I get this exception:

"Connection object was null. This could be due to a misconfiguration of the
DataSourceFactory. Check the logs and Torque.properties to better determine
the cause."

In the Tomcat console I get this message when running in the remote debug
mode:

"DBCP borrowObject failed: java.sql.SQLException: [Microsoft][SQLServer 2000
Driver for JDBC]Fehler beim einrichten eines Sockets."

Where "Fehler beim einrichten eines Sockets." means "Cannot establish a
socket connection."

Here is the description of the JNDI datasource in the server.xml file:

<Context className="org.apache.catalina.core.StandardContext"
cachingAllowed="true" ... >
            <Resource auth="Container" name="jdbc/myDBname"
scope="Shareable" type="javax.sql.DataSource"/>
            <ResourceParams name="jdbc/myDBname">
              <parameter>
                <name>url</name>
 
<value>jdbc:microsoft:sqlserver://xxx.xxx.xxx.xxx:1433;DatabaseName=myDBname
;SelectMethod=cursor</value>
              </parameter>
              <parameter>
                <name>validationQuery</name>
                <value>select * from facility;</value>
              </parameter>
              <parameter>
                <name>maxIdle</name>
                <value>10</value>
              </parameter>
              <parameter>
                <name>maxActive</name>
                <value>20</value>
              </parameter>
              <parameter>
                <name>driverClassName</name>
                <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
              </parameter>
              <parameter>
                <name>maxWait</name>
                <value>10</value>
              </parameter>
              <parameter>
                <name>username</name>
                <value>my_user</value>
              </parameter>
              <parameter>
                <name>factory</name>
 
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
              </parameter>
              <parameter>
                <name>password</name>
                <value>my_password</value>
              </parameter>
            </ResourceParams>
        </Context>

And here is what I configured in the Torque.properties:

torque.database.default.adapter=mssql

## Using jndi
torque.dsfactory.default.factory=org.apache.torque.dsfactory.JndiDataSourceF
actory
torque.dsfactory.default.jndi.path=java:comp/env/jdbc/myDBname

Does anybody ever had to deal with this kind of failure?
What am I doing wrong?

Any help is aprechiated.

Thanks for attention!
Harry




Reply via email to