Hi,

I'm not using Sybase under Tomcat; I have PostgreSQL...

Eclipse? My configuration is, Eclipse does not modify Tomcat
configuration (this is the default)

In your WebContent under META-INF create context.xml with the
<Resource ... /> definition. The <Context /> element does not require
any attributes:
<Context>
  <Resource ... your="attributes" ... />
</Context>

And finaly, place the JDBC driver JAR into your WEB-INF lib.

Catalina will automaticaly load your driver. My configuration is
working properly.

This configuration is working for me fine!

JNDI names? Look at the JNDI section in the J2EE Tutorial in the Sun's
web site. The examples are very helpful.

There is also another question:
It's good solution to place JDBC driver into the webapp's lib directory?


Hope it helps

PETR

PS.: My Adaptive Server Enterprise 15 is working good, but not under
Tomcat; it's standalone application... The initialization, driver URL
was taken from the Sybase's JDBC documentation on their web sites.


On 3/3/06, Tom Bednarz <[EMAIL PROTECTED]> wrote:
> I try to configure a JDBC DataSource for my Adaptive Server Anywhere 9
> database. Unfortunately without any success so far!
> I use Tomcat 5.5.18.
>
> The error is well known and looks as follows:
>
> org.apache.jasper.JasperException: Unable to get connection, DataSource
> invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
> JDBC driver of class '' for connect URL 'null'"
>     
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>
> I use the JDBCODBC driver to connect. Here is the configuration:
>
> server.xml
>
>     <Resource
>       name="jdbc/MyService"
>       type="javax.sql.DataSource"
>       password="sql"
>       driverClassName="ianywhere.ml.jdbcodbc.IDriver"
>       maxIdle="2"
>       maxWait="5000"
>       validationQuery="select * from CodeTable"
>       username="dba"
>       url="jdbc:odbc:dsn=MyService"
>       maxActive="50"
>       removeAbandoned="true"
>       removeAbandonedTimeout="60"
>       logAbandoned="true"/>
>
> Web.xml
>
>   <resource-ref>
>       <description>Database connection</description>
>       <res-ref-name>jdbc/MyService</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>   </resource-ref>
>
> Note: I currently do NOT deplay using a WAR file since I use Eclipse as
> develpment environment to debug etc. So I do NOT have an application
> specific context.xml file at the moment.
>
> Could anybody please explain what needs to be put into the name
> property? It seems that jdbc/ is mandatory but what needs to follow the
> slash is not clear to me! Is it the ODBC datasource name, the database
> name or any choosen name??
>
> Many thanks for your help.
>
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to