Hi Cris, Your Resource name is TestDB and you are trying to get the datasource using WolfDB.
Check out your code. HTH venkat -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Venkat Sent: Tuesday, February 11, 2003 2:12 PM To: SAP Subject: RE: Parameter Connection Pool Hi Cris; Did you place the sapdbc.jar in tomcat common/lib dir? I tried it with my example and itz working fine.If you want i can send the part of server.xml file and web.xml and code. regards venkat -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of chris weber Sent: Tuesday, February 11, 2003 12:31 PM 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 _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
