hello all,

i have a pdf generation working that generates its xml from a sql server
database.
it is working with the microsoft jdbc driver.

i'm now trying to switch to the jTDS (http://jtds.sourceforge.net/) jdbc
driver

- i have switched the cocoon.xconf file
- i have added the jar file to the classpath 
- added the driver initialisation to the web.xml

when i run the pdf generation again it throws a 

Original exception : java.lang.RuntimeException: Could not get the
datasource
org.apache.avalon.excalibur.datasource.NoValidConnectionException:
at
org.apache.cocoon.www.PDFGeneration.invoice_xsp.generate(C:\Tomcat5\work\Cat
alina\localhost\eipp\cocoon-files\org/apache/cocoon/www/PDFGeneration\invoic
e_xsp.java:811) 
at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenera
tor.java:260) 
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv
entPipeline.java:250) 
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS
treamPipeline.java:390) 
......

and i can't seem to find out why.

when i debug the invoice_xsp.java file (with println(..) )
i find that the exception gets thrown at the 
         _esql_connection.connection =
_esql_connection.datasource.getConnection();
line.

if i connect to the database directly from within the invoice.xsp it works
so the jtds driver is available and initialized

        Connection Conn =
DriverManager.getConnection("jdbc:jtds:sqlserver://myServer:1433/myDatabaseN
ame", "aUser", "password");
            DatabaseMetaData dmd = Conn.getMetaData();
            if (dmd != null)
            {
                 Statement Ex1Stmt = Conn.createStatement();
                ResultSet resultSet = Ex1Stmt.executeQuery("select
Description from dbo.DocumentTypes");
                resultSet.next();
                System.out.println("some detail from the database: " +
resultSet.getString("Description") );
            }
            Conn.close();


any suggestions what i can do to find what the problem is would be highly
appreciated.

thanks,
tom



----------------------------------------------------------------------------
-----------------
cocoon.xconf change:

    <jdbc name="blabla">
        <dburl>jdbc:jtds:sqlserver://myServer:1433/myDatabaseName</dburl>
           <user>aUser</user>
          <password>password</password>
    </jdbc>

instead of 

    <jdbc name="blabla">
 
<dburl>jdbc:microsoft:sqlserver://myServer:1433;DatabaseName=myDatabaseName<
/dburl>
      <pool-controller min="5" max="20"/>
      <user>aUser</user>
      <password>password</password>
    </jdbc>
----------------------------------------------------------------------------
-----------------
web.xml file snippet
    <init-param>
      <param-name>load-class</param-name>
      <param-value>net.sourceforge.jtds.jdbc.Driver</param-value>
    </init-param>
----------------------------------------------------------------------------
-----------------

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

Reply via email to