Hi Peng and All, Looks like it should have worked, even with empty sql query string.
Here are some more clarifications that arouse to my mind: 1. Ok we write a valid query, suppose, a 'select *' query, what is the purpose of this query, how does pooling related it, does it check by running thru??? and only then release a connection??? 2. How can we know that a connection we are getting is from the pool created. 3. How can we know connections pooled up at the start of the server, any message on the console???. Thanks again in advance. Regards Ashruf -----Original Message----- From: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]] Sent: Monday, December 23, 2002 3:32 PM To: Ashruf Hussain Subject: Re: Server Hangs Up when lookup for jndi name is made. (URGENT) Great. I'm not sure whether we can call that a bug or not as we submit a blank value for that parameter as it is suppose to contain a value. No biggie though, since we can get around it. Ashruf Hussain wrote: > Thanks Peng, > > I got it. :) :) > > Regards > Ashruf > > -----Original Message----- > From: Peng Tuck Kwok [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 23, 2002 1:51 PM > To: Tomcat Users List > Subject: Re: Server Hangs Up when lookup for jndi name is made. (URGENT) > > > Check out the parameter name validationQuery, either remove it or > provide it a sql select statement. so that it looks like: > <parameter> > <name>validationQuery</name> > <value>select * from dummytable</value> > </parameter> > > The table has to be valid and (apparently) cannot return zero rows > according to the docs. > > Try it and see if it works. > > Ashruf Hussain wrote: > >>Hi Tomcat Users, >> >>Given below are server.xml and web.xml entries and code to access dbcp >>resource from servlet. >>When servlet is looking up for jndi name server hangs up with no response, >>with 100% cpu busy signal on win2k box. >> >>With no exception message logged logs files. >> >>I using type 4 jdbc3.0 driver from DataDirect Technologies. >> >>Thanks in advance. >>------------------ >>DBCP entry in server.xml within the context entry of web appln. :******* >> >><Resource name="jdbc/Resourcesdb" scope="Shareable" >>type="javax.sql.DataSource"/> >> <ResourceParams name="jdbc/Resourcesdb"> >> <parameter> >> <name>validationQuery</name> >> <value></value> >> </parameter> >> <parameter> >> <name>maxWait</name> >> <value>5000</value> >> </parameter> >> <parameter> >> <name>maxActive</name> >> <value>4</value> >> </parameter> >> <parameter> >> <name>password</name> >> <value>resourcesdb</value> >> </parameter> >> <parameter> >> <name>url</name> >> >> > > <value>jdbc:datadirect:sqlserver://serverName:1433;databaseName=name;User=na > >>me;Password=name</value> >> </parameter> >> <parameter> >> <name>driverClassName</name> >> <value>com.ddtek.jdbc.sqlserver.SQLServerDriver</value> >> </parameter> >> <parameter> >> <name>maxIdle</name> >> <value>2</value> >> </parameter> >> <parameter> >> <name>username</name> >> <value>resourcesdb</value> >> </parameter> >> </ResourceParams> >> >>Entry for accessing DBCP resource in web.xml:********** >> >><resource-ref> >> <description>Datasource example</description> >> <res-ref-name>jdbc/Resourcesdb</res-ref-name> >> <res-type>javax.sql.DataSource</res-type> >> <res-auth>Container</res-auth> >></resource-ref> >> >>Servlet code:*********** >> >> System.out.println("LoginServlet: Getting >>InitialContext..."); >> InitialContext initCtx = new InitialContext(); >> System.out.println("LoginServlet: Got >>InitialContext"); >> >> System.out.println("NameInNamespace ==> " + >> initCtx.getNameInNamespace()); >> >> DataSource ds = >>(DataSource)initCtx.lookup("java:comp/env/jdbc/Resourcesdb"); >> >> if (ds != null) >> { >> conn = ds.getConnection(); >> >> if (conn != null) >> { >> System.out.println("Got Connection ==> \n" + >>conn); >> >> } >> else >> { >> System.out.println("Failed to get >>connection."); >> } >> } >> else >> { >> System.out.println("Failed to get datasource."); >> } >> >>--- >>Regards, >>Mohammed Ashruf Hussain >>Software Engineer. >>Virtusa, Corp. (formerly erunway) >>Work 040 23414200 ext(303) >>www.virtusa.com >> >> >> >>-- >>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]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
