Hi Chris,

This seems to be a Tomcat question, so would you mind asking
there (http://jakarta.apache.org/site/mail.html) about how
to setup a data source as you like or getting more traceback
if something really goes wrong here?

Regards
Alexander Schr�der
SAP Labs Berlin

> -----Original Message-----
> From: chris weber [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 11, 2003 8:01 AM
> To: [EMAIL PROTECTED]
> Subject: Parameter Connection Pool
> 
> 
> Hello NG,
> 
> i try to config a jakarta 4.1.18 web- server, I have some problem. I
> seems not possible, to create a datasource with the current 
> jdbc driver.
> 
> 
> Here are my config datas:
> Jdk: 1.4.1
> Tomcat: 4.1.18 LE
> 
> Definition of the datasource at the <context> (server.xml)
> 
>      <Resource name="jdbc/TestDB" auth="Container"
> type="javax.sql.DataSource"/>
>      <ResourceParams name="jdbc/TestDB">
>         <parameter>
>            <name>factory</name>
>            
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>         </parameter>
>            <parameter>
>               <name>maxActive</name>
>               <value>100</value>
>             </parameter>
>             <parameter>
>               <name>maxIdle</name>
>               <value>30</value>
>             </parameter>
>             <parameter>
>               <name>maxWait</name>
>               <value>10000</value>
>             </parameter>
>             <parameter>
>               <name>user</name>
>               <value>dba</value>
>             </parameter>
>             <parameter>
>               <name>password</name>
>               <value>dba</value>
>             </parameter>
>             <parameter>
>               <name>driverClassName</name>
>               <value>com.sap.dbtech.jdbc.DriverSapDB</value>
>             </parameter>
>             <parameter>
>               <name>url</name>
>               <value>jdbc:sapdb://192.168.1.175/test</value>
>             </parameter>
>          </ResourceParams>
> 
> My Config Parameter in web.xml
> <resource-ref>
>     <description>Datenquelle fuer Wolf-Plantafel</description>
>     <res-ref-name>jdbc/TestDB</res-ref-name>
>     <res-type>javax.sql.DataSource</res-type>
>     <res-auth>Container</res-auth>
>   </resource-ref>
> 
> To create a simple connection test, I used this code in a jsp and in a
> bean.
>   String strSQL = "SELECT user_name FROM dba.users ORDER BY 
> user_name";
>   Statement stmt;
> ResultSet result;
>   Connection userconnect;
>   Context initCtx;
>   Context envCtx;
>   DataSource ds;
>   String error = "No Error"; /* Only for looking if the naming context
> is null */
> try {
>       initCtx = new InitialContext();
>       dummy = "Nach Initial Context";
>       envCtx = (Context) initCtx.lookup("java:comp/env");
>       if (envCtx != null) {
>         error = "envCtx != null!!!";
>       }
>       ds = (DataSource) envCtx.lookup("jdbc/WolfDB");
>       userconnect = ds.getConnection();
> 
>       /*userconnect = DriverManager.getConnection (jdbcStr +"//" +
> dbtarget + "/"+dbName, dba, dbpass); */
>       stmt = userconnect.createStatement();
>       result = stmt.executeQuery(strSQL);
>         if (result == null) {
>          dummy = "Result is Null!"; 
>       }
>       result.close();
>       userconnect.close();
>       envCtx.close();
>       initCtx.close();
> 
>     } catch(java.sql.SQLException e)  {
>       error = "SQL Exeption!";
>       //e.printStackTrace();
>       
>     } catch (javax.naming.NamingException e) {
>       //error = "NAMING Exeption!";
>       e.printStackTrace();
> 
>     }
> 
> I tried it in many configurations, but I got never  a datasource. 
> 
> Perhaps, somebody can help me,
> 
> Best Regards, Chris
> 
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to