RE: Tomcat 4.1.30 not restoring JDBC connections
Hi, You need to configure the connection pool as to how it handles connection. For example, you would want a validation query if the pool supports it (assuming you're using DBCP, it does), and a recycle policy. By default these aren't done because they cost time, and a situation like yours with the network going down periodically is a recipe for other disasters anyways. Yoav Shapira http://www.yoavshapira.com -Original Message- From: Alex Korneyev [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 12:11 PM To: Tomcat Users List Subject: Tomcat 4.1.30 not restoring JDBC connections Hello All, has anyone ever experienced the following: we are using Tomcat's 4.1.30 connection pool. For some reason, when network connection goes down, even for 1 sec, connection pool is not smart enough to either get rid of a connection and try get another one, or reconnect; any ideas? Alex K. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4.1.30 not restoring JDBC connections
Hello All, has anyone ever experienced the following: we are using Tomcat's 4.1.30 connection pool. For some reason, when network connection goes down, even for 1 sec, connection pool is not smart enough to either get rid of a connection and try get another one, or reconnect; any ideas? Alex K. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 4.1.30 not restoring JDBC connections
Whenever I encounter this problem I re-start the tomcat. On Mon, 22 Nov 2004 11:11:14 -0600, Alex Korneyev [EMAIL PROTECTED] wrote: Hello All, has anyone ever experienced the following: we are using Tomcat's 4.1.30 connection pool. For some reason, when network connection goes down, even for 1 sec, connection pool is not smart enough to either get rid of a connection and try get another one, or reconnect; any ideas? Alex K. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDBC connections
What do I need to download to establish/create a JDBC connection? //SIGNED// Jerry Nelson
Re: JDBC connections
You need a JDBC driver for your selected DBMS Nelson, Jerry W, Contractor 146CF, SCB escribió: What do I need to download to establish/create a JDBC connection? //SIGNED// Jerry Nelson -- John Villar Gerente de Proyectos Computadores Flor Hard Soft 2058 C.A. www.florhard.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDBC connections
That would Microsoft Access and Microsoft SQL. //SIGNED// Jerry Nelson PS, I can't receive attachments unless you rename them. -Original Message- From: John Villar [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 1:39 PM To: Tomcat Users List Subject: Re: JDBC connections You need a JDBC driver for your selected DBMS Nelson, Jerry W, Contractor 146CF, SCB escribió: What do I need to download to establish/create a JDBC connection? //SIGNED// Jerry Nelson -- John Villar Gerente de Proyectos Computadores Flor Hard Soft 2058 C.A. www.florhard.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDBC connections
You should be able to use the standard sun.jdbc.odbc.JdbcOdbcDriver class to connect to those DMBS's. Robert S. Harper 801.265.8800 ex. 255 -Original Message- From: Nelson, Jerry W, Contractor 146CF, SCB [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 2:39 PM To: 'Tomcat Users List' Subject: RE: JDBC connections That would Microsoft Access and Microsoft SQL. //SIGNED// Jerry Nelson PS, I can't receive attachments unless you rename them. -Original Message- From: John Villar [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 1:39 PM To: Tomcat Users List Subject: Re: JDBC connections You need a JDBC driver for your selected DBMS Nelson, Jerry W, Contractor 146CF, SCB escribió: What do I need to download to establish/create a JDBC connection? //SIGNED// Jerry Nelson -- John Villar Gerente de Proyectos Computadores Flor Hard Soft 2058 C.A. www.florhard.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBC connections
With Access, AFAIK, you are going to need the ODBC Bridge driver (That would imply establishing a system DSN on the ODBC options and using the bridge driver just search the web) For SQL Server, use the lastest version of jTDS at http://jtds.sf.net Nelson, Jerry W, Contractor 146CF, SCB escribió: That would Microsoft Access and Microsoft SQL. //SIGNED// Jerry Nelson PS, I can't receive attachments unless you rename them. -Original Message- From: John Villar [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 1:39 PM To: Tomcat Users List Subject: Re: JDBC connections You need a JDBC driver for your selected DBMS Nelson, Jerry W, Contractor 146CF, SCB escribió: What do I need to download to establish/create a JDBC connection? //SIGNED// Jerry Nelson -- John Villar Gerente de Proyectos Computadores Flor Hard Soft 2058 C.A. www.florhard.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: (JDBC Connections (was: Content Type)
epyonne, What is Tomcat's limitation on multiple connection to database? Tomcat has no limit on DB connections. Unless you are using a Realm, Tomcat does not have any control over db connections. I have a simple servlet application that connects to Oracle database for data. Since it is a very simple application, no connection pooling is used. Someone raised a question on whether Tomcat can handle hundreds of calls to the servlets and hundreds of connections to the Oracle database. Again, Tomcat doesn't care. The VM may care, though. Especially with Oracle, JDBC connections take a long time to establish and use of a lot of memory on the server, and often the client. You should use connection pooling for a number of reasons: 1. Performance (re-using connections takes less time than creating more) 2. Resource limiting (pool limits the number of total connections) 3. Configuration (easier to manage a connection pool than code to create connections on the fly and make sure they are closed/managed appropriately) -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] jdbc connections open?
I'm debugging an web app that seems to hang after three to four logins are initiated. One possible item to look at is the number of open connections to the MySQL database. The app was built around a number of Jakarta technologies about 8 months ago. What's the quickest way to check the number of open connections in MySQL? Thanks, Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pooled JDBC Connections
After much head scratching and misleading messages in the archive, lots of trial and error, and several bouts of cussing, I got pooling to work last night (using Tomcat 4.04 and mySQL). You need a jdbc driver (I'm using mm.mysql-2.0.14-bin.jar, obviously for mySQL). You also need commons-collections.jar, commons-dbcp.jar, and commons-pool.jar. These can be found deep in the unfriendly pages on jarkata.apache.org as part of a subproject for Tomcat. Take these 4 jar files and place them in $CATALINA_HOME/common/lib. Then take a look at one of the archive messages found at http://marc.theaimsgroup.com/?l=tomcat-userm=102225547106556w=2 This will show you what you need in your server.xml file (replace your own database username and password for his examples). Good luck and try getting inventive with the cussing, it helps. Steve -Original Message- From: Frank Apap [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 06, 2002 12:05 AM To: 'Tomcat Users List' Subject: RE: Pooled JDBC Connections I have searched them, although I do find some stuff its very contradicting and unclear. Some of the messages mention needing 3rd party software while others talk about built-in tomcat support (although I only found this for version 4.x). A more definitive answer on this would be GREATLY appreciated. Frank -Original Message- From: William Gustave [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 7:51 PM To: Tomcat Users List Subject: RE: Pooled JDBC Connections Search the archives.. -Original Message- From: Frank Apap [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 4:54 PM To: [EMAIL PROTECTED] Subject: Pooled JDBC Connections Does Tomcat version 3.3 or version 4.0 have support (built-in) for database pooling? If so does anyone have any doc's on how to set this up? Thanks in advance. Frank -- 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]
Pooled JDBC Connections
Does Tomcat version 3.3 or version 4.0 have support (built-in) for database pooling? If so does anyone have any doc's on how to set this up? Thanks in advance. Frank
RE: Pooled JDBC Connections
Search the archives.. -Original Message- From: Frank Apap [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 4:54 PM To: [EMAIL PROTECTED] Subject: Pooled JDBC Connections Does Tomcat version 3.3 or version 4.0 have support (built-in) for database pooling? If so does anyone have any doc's on how to set this up? Thanks in advance. Frank -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Pooled JDBC Connections
I have searched them, although I do find some stuff its very contradicting and unclear. Some of the messages mention needing 3rd party software while others talk about built-in tomcat support (although I only found this for version 4.x). A more definitive answer on this would be GREATLY appreciated. Frank -Original Message- From: William Gustave [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 7:51 PM To: Tomcat Users List Subject: RE: Pooled JDBC Connections Search the archives.. -Original Message- From: Frank Apap [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 4:54 PM To: [EMAIL PROTECTED] Subject: Pooled JDBC Connections Does Tomcat version 3.3 or version 4.0 have support (built-in) for database pooling? If so does anyone have any doc's on how to set this up? Thanks in advance. Frank -- 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]
Re: Setting up jdbc connections
Here is how I install mysql JDBC. 1. In server.xml (no need realm): Resource name=lev/DataSource auth=Container type=javax.sql.DataSource/ ResourceParams name=lev/DataSource parameternameuser/namevalue.../value/parameter !-- your login -- parameternamepassword/namevalue.../value/parameter!-- your passwd -- parameternamedriverClassName/name valueorg.gjt.mm.mysql.Driver/value/parameter parameternamedriverName/name valuejdbc:mysql://localhost:3306/WV/value/parameter /ResourceParams 2. In $CATALINA_HOME/webapps/examples/WEB-INF/web.xml: resource-ref res-ref-namelev/DataSource/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref 3. In yout JSP or Bean: Context ctx = new InitialContext(); Context envCtx = (Context)ctx.lookup(java:comp/env); DataSource _ds = (DataSource)envCtx.lookup(lev/DataSource); Connection con _ds.getConnection(); ... Statement st = con.createStatement(...); ResultSet rs = st.executeQuery(select * from bla_bla); JNDI will create instance of your DataSource (with automatic connection). But you have to have tyrex*.jar in one of common dirs. If not I advise you to switch to Tomcat 4.0.x. Also you must put your (Postgres) JDBC jar into $CATALINA_HOME/lib Good luck. Andrew Falanga wrote: Hello everyone, Setting up Tomcat is NO easy project. I've been struggling for about a week and a half to get tomcat to read a special servlet/application/I really don't know what to call it. (Unfortunately, that's my biggest problem, I'm very unfamiliar with things I'm playing around with right now.) Ok, in simplest terms possible here's the deal. I'm trying to get a working model of something my company calls a portal. Basically, it's nothing more than a product that will allow a person to use *.jsp rendered web pages to access/control/manipulate data contained withing Oracle databases. This is the long term. Right now, I need to get the application working to allow someone to log in. The database which controls user access is NOT part of Oracle. It is a PostgreSQL database. How, exactly, do I setup the JDBC stuff to interact with PostgreSQL? I've been reading through the users guide, the paper on server.xml and the FAQ. The information is comprehensive, I do think lacking in some parts, but none-the-less comprehensive. (I do not mean to start flame wars or anything else. However, for example, I downloaded and installed tomcat 3.3a via rpm for Red Hat Linux, the rpm was made by tomcat developers not red hat. After installing, I'm reading through the users guide and there are several directories meantioned that DO NOT exist. Such as, %TOMCAT_HOME/bin and many others. This is what I mean by lacking.) How exactly am I going to go about setting up the database connectivity? From what I've read, I've got to configure some kind of a JDBC Realm in the server.xml, but how exactly. I did try, following the syntax example given in one of the user guide documents, but after restarting tomcat, tomcat was broken. Absolutely, nothing was being served up. I did make syntax substitutions to allow for my database vs. the database given in the example, and yes I'm absolutely open to the fact that my syntax was wrong. Basically, what needs to be done? I'm really nearing the end of my rope on this one. Andy -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- Lev AssinovskyPeterlink Web ProgrammerSt. Petersburg, Russia Tel/Fax: +7 812 3275343 197022 ul.Chapigina 7Á E-mail: [EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Setting up jdbc connections
Hello everyone, Setting up Tomcat is NO easy project. I've been struggling for about a week and a half to get tomcat to read a special servlet/application/I really don't know what to call it. (Unfortunately, that's my biggest problem, I'm very unfamiliar with things I'm playing around with right now.) Ok, in simplest terms possible here's the deal. I'm trying to get a working model of something my company calls a portal. Basically, it's nothing more than a product that will allow a person to use *.jsp rendered web pages to access/control/manipulate data contained withing Oracle databases. This is the long term. Right now, I need to get the application working to allow someone to log in. The database which controls user access is NOT part of Oracle. It is a PostgreSQL database. How, exactly, do I setup the JDBC stuff to interact with PostgreSQL? I've been reading through the users guide, the paper on server.xml and the FAQ. The information is comprehensive, I do think lacking in some parts, but none-the-less comprehensive. (I do not mean to start flame wars or anything else. However, for example, I downloaded and installed tomcat 3.3a via rpm for Red Hat Linux, the rpm was made by tomcat developers not red hat. After installing, I'm reading through the users guide and there are several directories meantioned that DO NOT exist. Such as, %TOMCAT_HOME/bin and many others. This is what I mean by lacking.) How exactly am I going to go about setting up the database connectivity? From what I've read, I've got to configure some kind of a JDBC Realm in the server.xml, but how exactly. I did try, following the syntax example given in one of the user guide documents, but after restarting tomcat, tomcat was broken. Absolutely, nothing was being served up. I did make syntax substitutions to allow for my database vs. the database given in the example, and yes I'm absolutely open to the fact that my syntax was wrong. Basically, what needs to be done? I'm really nearing the end of my rope on this one. Andy -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Setting up jdbc connections
On 03/04/2002 04:18 PM, Andrew Falanga wrote: Hello everyone, Hi, Setting up Tomcat is NO easy project. I've been struggling for about a week and a half to get tomcat to read a special servlet/application/I really don't know what to call it. (Unfortunately, that's my biggest problem, I'm very unfamiliar with things I'm playing around with right now.) Setting up Tomcat is a breeze, but not for somebody who doesn't know the difference between a servlet and an application. Ok, in simplest terms possible here's the deal. I'm trying to get a working model of something my company calls a portal. Basically, it's nothing more than a product that will allow a person to use *.jsp rendered web pages to access/control/manipulate data contained withing Oracle databases. This is the long term. Right now, I need to get the application working to allow someone to log in. The database which controls user access is NOT part of Oracle. It is a PostgreSQL database. Designing and implementing that nothing more than a product is what many of us have gone through 4 years of university and hundreds of books and white papers to learn to do. How, exactly, do I setup the JDBC stuff to interact with PostgreSQL? I've been reading through the users guide, the paper on server.xml and the FAQ. The information is comprehensive, I do think lacking in some parts, but none-the-less comprehensive. (I do not mean to start flame wars or anything else. However, for example, I downloaded and installed tomcat 3.3a via rpm for Red Hat Linux, the rpm was made by tomcat developers not red hat. After installing, I'm reading through the users guide and there are several directories meantioned that DO NOT exist. Such as, %TOMCAT_HOME/bin and many others. This is what I mean by lacking.) If you don't understand that $TOMCAT_HOME (or %TOMCAT_HOME%, if you're on WIndows) refers to the environment variable TOMCAT_HOME you were supposed to create as part of installation, I suggest you go back and first learn a few basics of the operating system you're working on (mail headers indicate Linux). How exactly am I going to go about setting up the database connectivity? From what I've read, I've got to configure some kind of a JDBC Realm in the server.xml, but how exactly. I did try, following the syntax example given in one of the user guide documents, but after restarting tomcat, tomcat was broken. Absolutely, nothing was being served up. I did make syntax substitutions to allow for my database vs. the database given in the example, and yes I'm absolutely open to the fact that my syntax was wrong. Basically, what needs to be done? I'm really nearing the end of my rope on this one. For basic database connectivity you don't need JDBC realm, all you need is a JDBC driver for the RDBMS you're working with (PostgreSQL or Oracle) and use the regular JDBC syntax in either JSPs or servlets. You can also use JDBC taglib, but you still need the driver. If this paragraph doesn't make sense, I suggest you stay away from Tomcat until you learn the basics of Java and J2EE programming. Andy Emir. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Setting up jdbc connections
Andrew Falanga wrote: However, for example, I downloaded and installed tomcat 3.3a via rpm for Red Hat Linux, ... Such as, %TOMCAT_HOME/bin and many others. This looks kinda weird to me. Can you provide more specifics to our helpful friends on the list? OS? Hardware? Did you ever get the examples to run? Where did you get the RPM? (CD?Redhat?jakarta?) Did you let it unpack by the defaults? Etc. Joel Rees -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
JDBC Connections
Hi, We have implemented a simple JDBC connection pool for our servlet - do you think it is better to grab a connection once when a request is received and use that connection throughout the processing or should the connection be used only when necessary and released as soon as possible?? Regards, Matthew.
Re: JDBC Connections
Hi, I feel its better to be used only when necessary and released as soon as possible. Best regards Sib Mathew Clark [EMAIL PROTECTED] on 05/28/2001 10:07:34 PM Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: JDBC Connections Hi, We have implemented a simple JDBC connection pool for our servlet - do you think it is better to grab a connection once when a request is received and use that connection throughout the processing or should the connection be used only when necessary and released as soon as possible?? Regards, Matthew.
RE: JDBC Connections
Mathew, It's been my experience to only use it when necessary and release it back to the pool when done. Otherwise, it is redundant to have a pool to being with. The pool's power comes in its management of available connections, if you minimize the available connections, the pool will try to grow and eventually lose it's effectiveness. You will also experience a performance hit for it. Persistance layer implementaions rely on that principal in managing its connection pool. Paulo Pereira Java/Web Developer Sentricity Inc., A Division of Sentex Communications Corp., www.sentricity.com -Original Message- From: Mathew Clark [mailto:[EMAIL PROTECTED]] Sent: Monday, May 28, 2001 11:38 AM To: [EMAIL PROTECTED] Subject: JDBC Connections Hi, We have implemented a simple JDBC connection pool for our servlet - do you think it is better to grab a connection once when a request is received and use that connection throughout the processing or should the connection be used only when necessary and released as soon as possible?? Regards, Matthew.
Re: JDBC Connections
s == sibendud [EMAIL PROTECTED] writes: s Hi, I feel its better to be used only when necessary and s released as soon as possible. Best regards Sib I would qualify this advice by adding only when using DB connection pools. The overhead in making and breaking DB connections is considerable. -- Gary Lawrence Murphy [EMAIL PROTECTED] TeleDynamics Communications Inc Business Innovations Through Open Source Systems: http://www.teledyn.com Computers are useless. They can only give you answers.(Pablo Picasso)
JDBC Connections
Can anyone help me? I have: - SCO UnixWare 7.1.1 - Informix Online 9.20 and JDBC 2.0 - JDK 1.2.2 - Tomcat 3.2.1 When a make a JDBC connection to the DBMS with a JavaBean (scope=session) and i close the browser, the connection remain up and it will go down only after several hours. How can i do to set up a connection that dies when i close the browser? Thank you.
RE: JDBC Connections
Your problem is that your session object (holding the connection) is not being notified when the session is dropped. nb, when a user closes a browser is not when the session will be dropped. You'll have to add i) a time out to the session (say 10 minutes?) and ii) give the user a logout button so that they can logout cleanly and promptly. See the Servlet specs for more details. An object in the session scope can request to be notified of when it is removed from the session (usually because the session is being closed down). Take a look at javax.servlet.http.HttpSessionBindingListener, it is an interface with 2 methods on it. Just make your object implement this interface and the bind/unbind method will be called when the object is added to the session/removed from the session respectively. Using these notifications your object will be able to open/close the database connection. Warning. If you're holding a connection open for such a long time, make sure that you're not locking any tables in the database between user requests otherwise the scaleable performance of the web site will drastically suffer. - Chris Brainbench MVP Java2. -Original Message- From: Raffaele Carl [mailto:[EMAIL PROTECTED]] Sent: 16 March 2001 13:15 To: [EMAIL PROTECTED] Subject: JDBC Connections Can anyone help me? I have: - SCO UnixWare 7.1.1 - Informix Online 9.20 and JDBC 2.0 - JDK 1.2.2 - Tomcat 3.2.1 When a make a JDBC connection to the DBMS with a JavaBean (scope=session) and i close the browser, the connection remain up and it will go down only after several hours. How can i do to set up a connection that dies when i close the browser? Thank you.