Hi there, 
   
  I've trying to setup a Datasource in Tomcat 5.028 and I can't get it to work. 
I've meticulously followed the tomcat documentation and still no luck. I went 
into several famous forums and still didn't work. 
   
  For starter, I tried adding the Datasource manually in the admin screen and 
was able to save it, however, I don't see the Datasouce entry anywhere in 
Tomcat files, specifically the ...conf/server.xml.
   
  Here my code in server.xml
  .
  existing code 
  .
  <Context path="/jspbook_site" docbase="jspbook_site"
  debug="0" priveleged="true">
 <Resource name="jdbc/jspbook_site"
  auth="Container"
  type="javax.sql.DataSource"/>
 <ResourceParams name="jdbc/jspbook_site">
  <parameter>
   <name>username</name>
   <value>sa</value>
  </parameter>
  <parameter>
   <name>password</name>
   <value></value>  
  </parameter>
  <parameter>
   <name>driverClassName</name>
   <value>org.hsqldb.jdbcDriver</value>  
  </parameter>
  <parameter>
   <name>url</name>
   <value>jdbc:hsqldb:/usr/Tomcat 
5.0/webapps/jspbook_site/WEB-INF/jspbookdb</value>  
  </parameter>
 </ResourceParams>
</Context>
   
  Here is my call to the Datasouce...
   
  .
  .
  InitialContext ctx = new InitialContext();
      DataSource ds =
        (DataSource)ctx.lookup("java:comp/env/jdbc/jspbook_site");
      Connection conn = ds.getConnection();
   
  .
  .
   
  I verified that org.hsqldb.jdbcDriver is working when using DriverManager 
class.
   
  Thank you very much.

Reply via email to