No i dont have driver specific code. But something like this raises
compilation errors as the jar file that includes the Connection,
PreparedStatement and ResultSet objects is not accessible from the
WEB-INF/lib folder.

Context envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource)
envCtx.lookup("jdbc/EmployeeDB");

Connection conn = ds.getConnection();

PreparedStatement lv_pstmt = null;
ResultSet lv_rs = null;

To be able to compile the above, the jdbc driver in Tomcat/common/lib has to
be in the classpath i guess.

Thanks

On Fri, Nov 13, 2009 at 8:56 AM, Mikolaj Rydzewski <m...@ceti.pl> wrote:

> Ziggy wrote:
>
>> when i build the war file using ANT, it refuses to build
>> the war file unless i have the jdbc driver in the application's
>> WEB-INF/lib
>> folder
>>
> Do you use any driver specific calls in your code? Since you use JNDI, you
> should rely only on DataSource provided by container. Hence, no piece of
> your code should have references to classes from JDBC driver.
>
>
> --
> Mikolaj Rydzewski <m...@ceti.pl>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to