General discussion

Locked

*** Database Connection Pooling *****

By anand75 ·
hi,the program SimpleSample.java
works perfectly fine as a standalone program.
i am using RedHat8, Mysql 4 and Tomcat 4. i want to use this ConnectionPooling method for a JSP file. can anyone help me ?.
Here is the code for SimpleSample.java
import com.devdaily.opensource.database.DDConnectionBroker;
import java.sql.*;
public class SimpleSample
{
String driver = null;
String url = null;
String username = null;
String password = null;
int minConnections = 0;
int maxConnections = 0;
long timeout = 0;
long leaseTime = 0;
String logFile = null;
DDConnectionBroker broker = null;
/**
* The main() method gets called first, and it just calls the constructor.
*/
public static void main(String[] args)
{
new SimpleSample();
}
/**
* This method sets the parameters that will be used to construct
* the DDConnectionBroker.
*/
void setUp()
{
driver = "com.mysql.jdbc.Driver";
url = "jdbc:mysql://localhost/anand";
username = "";
password = "";
minConnections = 10;
maxConnections = 100;
timeout = 100;
leaseTime = 60000;
logFile = "c:/temp/DDConnectionBroker.log";
broker = null;
}
public SimpleSample()
{
setUp();

try
{
// construct the broker
broker = new DDConnectionBroker(driver,
url,
username,
password,
minConnections,
maxConnections,
timeout,
leaseTime,
logFile);
}
catch (SQLException se)
{
System.err.println( se.getMessage() );

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums