Hi Clay, It's a small net. I hope you are well!!
I haven't tried using Struts yet, but I've been thinking about checking it out. I did try the JNDI/DBCP method described at the URL you posted and it does work and it seemed to be pooling correctly. However, the connection times out after a while which is a real pain. I haven't had time to figure out what's going on with that and work out fix for it yet. Also, DBCP seems a little immature to me at this point, so I'll probably wait a little while and try that again. I also tried the JNDI/Tyrex setup and was able to get a connection, but I couldn't tell if it was pooling properly and I ran into some bugs with Tyrex so I abandoned that approach. I've been using DbConnectionBroker using a set up similar to that described in Bergsten's "Java Server Pages" book. The connection is stable and the pooling is working well. I don't know how much of a load this will handle, but for the time being it's allowing me to concentrate on other things. I'd much rather be using JNDI, but I think that this is the most stable approach going right now. I hope this is at least a little bit helpful. Hang in there Cindy (sorry for the top post) At 08:33 AM 7/2/02 -0700, Clay Graham wrote: >Are alot of people having problems with the mySql drivers or am I being >myopic... > >i tried to do this with STRUTS datasource pooling and had the following >issues... > >I am asking a question because I am very suprised at an unexepected >behaviour and thought that someone may have a hint. > >I have linux 7.1 tomcat 404 ant struts 102 working and they have been >tested, and I am taking the next step by starting to connect to my MySql >database, all goodness. > >So my first step was to add the datasource in my struts-config.xml as >follows: > > <data-sources> > <data-source> > <set-property property="autoCommit" > value="false"/> > <set-property property="description" > value="The Test Datasource"/> > <set-property property="driverClass" > value="org.gjt.mm.mysql.Driver"/> > <set-property property="maxCount" > value="4"/> > <set-property property="minCount" > value="2"/> > <set-property property="password" > value=""/> > <set-property property="url" > value="jdbc:mysql://localhost/test"/> > <set-property property="user" > value="root"/> > </data-source> > </data-sources> > >the next step was to add the mm.mysql-2.0.6.1.jar to my project's >WEB-INF/lib directory, the standard approach.... > >[clay@meis test]$ jar -tvf test.war|grep mm.mysql >390333 Sun Jun 30 16:20:20 PDT 2002 WEB-INF/lib/mm.mysql-2.0.6.1.jar > >I am sure this JAR has the mysql driver in it: > >[clay@meis test]$ jar -tvf web/WEB-INF/lib/mm.mysql-2.0.6.1.jar |grep >Driver > 15163 Sat Jun 16 09:20:28 PDT 2001 >mm.mysql-2.0.6/org/gjt/mm/mysql/Driver.java > 5443 Sat Jun 16 09:20:28 PDT 2001 >mm.mysql-2.0.6/org/gjt/mm/mysql/Driver.class > >so when I install the application using ant the following error occurs: > >----- Root Cause ----- >java.sql.SQLException: open: java.lang.ClassNotFoundException: >org.gjt.mm.mysql.Driver > >I have even put mm.mysql-2.0.6.1.jar in tomcat/common/lib and it does not >find the driver. I am asking this question on this list because it happens >in struts-config.xml > >so now I am looking into going over to the JNDI approach using the guide >at: > >http://marc.theaimsgroup.com/?l=tomcat-user&m=102225547106556&w=2 > >but I am interested if there advantages to the JNDO pool ober the STRUTS >pool if I go to all this trouble? > >this seems like something alot people would care about. > >Clay > >-----Original Message----- >From: Marc Logemann [SMTP:[EMAIL PROTECTED]] >Sent: Tuesday, July 02, 2002 5:35 AM >To: [EMAIL PROTECTED] >Subject: plain MySQL DataSource in Tomcat (i know, damn topic) > >Hi, > >i am one of the guys trying to get a valid MysqlDataSource reference via >JNDI. But i am getting crazy without knowing where the problem is (perhaps >the reason is, i cant debug JNDI too good, cause i am no expert in it..) > >i have the following: > >server.xml >---------- ><context ....> ><Resource name="jdbc/TestDB" auth="Cotainer" type="javax.sql.DataSource"/> ><ResourceParams name="jdbc/TestDB"> > <parameter> > <name>factory</name> > > <value>org.gjt.mm.mysql.jdbc2.optional.MysqlDataSourceFactory</va >lue> > </parameter> ><parameter> <name>user</name><value>root</value> </parameter> ><parameter> <name>password</name><value></value> </parameter> ><parameter> ><name>driverClassName</name><value>org.gjt.mm.mysql.jdbc2.optional.Mysql >DataSource</value></parameter> ><parameter> ><name>driverName</name><value>jdbc:mysql://localhost/maxbahr</value> ></parameter> ></ResourceParams> ></context> > >web.xml >------- ><web-app> ><resource-ref> > <description>DataSource MySQL</description> > <res-ref-name>jdbc/TestDB</res-ref-name> > <res-type> javax.sql.DataSource</res-type> > <res-auth>Container</res-auth> ></resource-ref> ></web-app> > >i placed the mysql mm jar into commons/lib > >When i run a servlet with the standard lookup code: > try { > javax.naming.Context jndictx = new InitialContext(); > if (jndictx == null) throw new Exception("Boom - No Context"); > > DataSource ds = > (DataSource) jndictx.lookup("java:comp/env/jdbc/TestDB"); > if (ds != null) { >[..] > >i get no exception but i also dont get any reference returned from lookup. > >I read tons of websites including the tomcat JNDI howto, without beeing >able to understand it >better (in fact it gets worse cause of thousands of combinations in the web >for server.xml and >web.xml) > >When i leave out factory in the server.xml, i get a tyrex exception >regarding loading a factory... > >I just thought that using a datasource is better than just calling the >DriverManager, but the >effort seems amazing... or i am too unclever... whatever... > >thx for help. >--- >greetings from >Marc Logemann >Homebase @ www.logemann.info > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED] >.org> >For additional commands, e-mail: ><mailto:[EMAIL PROTECTED]> > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
