Java-Connection Pool

Java-Connection Pool

How can I create a connection pool. My database... is Weblogic 8. Which is the best approach to create a connection pool?

View Answers

April 29, 2008 at 7:31 PM

Hi friend,

import java.sql.*;
import java.io.*;

public class ConnectionPool{
public static void main(String[] args){
Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "register";
String driver = "com.mysql.jdbc.Driver";
Statement st = null;
ResultSet rs = null;
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"root","root");
System.out.println("Connected to the database");
con.close();
}
catch(Exception e){
System.out.println(e);
}
}
}


--------------------------------

read for more information,

http://www.roseindia.net/jdbc/









Related Tutorials/Questions & Answers:
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database is MS SQL server 2000(username-sa, pwd-admin) and my application server is Weblogic 8. Which is the best approach to create a connection pool? Kindly help
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database... is Weblogic 8. Which is the best approach to create a connection pool? ...{ public static void main(String[] args){ Connection con = null; String url
Advertisements
POOL
and filling pools. Create pool class that calculates the price of a service call... on the amount of time it will take to fill a customer's pool with water. Table below...) for a pool. Pool class should have methods to calculate volume, capsity
how to writw connection pool coding
how to writw connection pool coding  java connection poolprint("code sample
Pool Chlorine
Pool Chlorine  *** Deleted by Admin ***** Pool Chlorine Watson's of Cincinnati is a toy store for adults offering above ground pools, pool supplies, Envisions Home Theater electronics, home theater furniture, casual patio
Pool Chemicals
Pool Chemicals  **delted by admin *** a toy store **deleted by admin** offering above ground pools, pool supplies, Envisions Home Theater electronics, home theater furniture, casual patio furniture, spas & hot tubs etc
Version of commons-pool>commons-pool dependency
List of Version of commons-pool>commons-pool dependency
Version of excalibur-pool>excalibur-pool dependency
List of Version of excalibur-pool>excalibur-pool dependency
Version of excalibur-pool>excalibur-pool-impl dependency
List of Version of excalibur-pool>excalibur-pool-impl dependency
Version of excalibur-pool>excalibur-pool-instrumented dependency
List of Version of excalibur-pool>excalibur-pool-instrumented dependency
Version of excalibur-pool>excalibur-pool-api dependency
List of Version of excalibur-pool>excalibur-pool-api dependency
ModuleNotFoundError: No module named 'pool'
ModuleNotFoundError: No module named 'pool'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pool' How to remove the ModuleNotFoundError: No module named 'pool' error
threads & autorelease pool
threads & autorelease pool  How to set autorelease pool for NSThread method in Objective C?   [NSThread detachNewThreadSelector:@selector... {   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];   //Do stuff   [pool release
Artifacts of commons-pool
List of Artifacts of commons-pool maven depenency
Artifacts of excalibur-pool
List of Artifacts of excalibur-pool maven depenency
java connection leak
java connection leak  How to check the connection leak in Java
Maven Repository/Dependency: excalibur-pool | excalibur-pool
Maven Repository/Dependency of Group ID excalibur-pool and Artifact ID excalibur-pool. Latest version of excalibur-pool:excalibur-pool dependencies. # Version Release Date You can read
Maven Dependency commons-pool >> 1.0
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version1.0 in your project
Maven Dependency commons-pool >> 1.1-dev
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version1.1-dev in your project
Maven Dependency commons-pool >> 1.1
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version1.1 in your project
Maven Dependency commons-pool >> 1.1-RC1
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version1.1-RC1 in your project
Maven Dependency commons-pool >> 1.1-RC2
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version1.1-RC2 in your project
Maven Dependency commons-pool >> 1.2
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version1.2 in your project
Maven Dependency commons-pool >> 1.3
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version1.3 in your project
Maven Dependency commons-pool >> 1.4
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version1.4 in your project
Maven Dependency commons-pool >> 20020501
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version20020501 in your project
Maven Dependency commons-pool >> 20030623.172700
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version20030623.172700 in your project
Maven Dependency commons-pool >> 20030818.195203
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version20030818.195203 in your project
Maven Dependency commons-pool >> 20030821.192746
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version20030821.192746 in your project
Maven Dependency commons-pool >> 20030825.183949
You should include the dependency code given in this page to add Maven Dependency of commons-pool >> commons-pool version20030825.183949 in your project
Maven Dependency excalibur-pool >> 1.0
You should include the dependency code given in this page to add Maven Dependency of excalibur-pool >> excalibur-pool version1.0 in your project
Maven Dependency excalibur-pool >> 1.2
You should include the dependency code given in this page to add Maven Dependency of excalibur-pool >> excalibur-pool version1.2 in your project
Maven Dependency excalibur-pool >> 20020820
You should include the dependency code given in this page to add Maven Dependency of excalibur-pool >> excalibur-pool version20020820 in your project
Maven Repository/Dependency: commons-pool | commons-pool
Maven Repository/Dependency of Group ID commons-pool and Artifact ID commons-pool. Latest version of commons-pool:commons-pool dependencies. # Version Release Date 1 1.6
Version of excalibur>excalibur-pool dependency
List of Version of excalibur>excalibur-pool dependency
Version of fulcrum>fulcrum-pool dependency
List of Version of fulcrum>fulcrum-pool dependency
Version of nanocontainer>nanocontainer-pool dependency
List of Version of nanocontainer>nanocontainer-pool dependency
ModuleNotFoundError: No module named 'class-pool'
ModuleNotFoundError: No module named 'class-pool'  Hi, My Python... 'class-pool' How to remove the ModuleNotFoundError: No module named 'class-pool' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'mongo-pool'
ModuleNotFoundError: No module named 'mongo-pool'  Hi, My Python... 'mongo-pool' How to remove the ModuleNotFoundError: No module named 'mongo-pool' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'object_pool'
ModuleNotFoundError: No module named 'object_pool'  Hi, My Python... 'object_pool' How to remove the ModuleNotFoundError: No module named 'object_pool' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'proxy_pool'
ModuleNotFoundError: No module named 'proxy_pool'  Hi, My Python... 'proxy_pool' How to remove the ModuleNotFoundError: No module named 'proxy_pool' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'thread_pool'
ModuleNotFoundError: No module named 'thread_pool'  Hi, My Python... 'thread_pool' How to remove the ModuleNotFoundError: No module named 'thread_pool' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'webdriver-pool'
ModuleNotFoundError: No module named 'webdriver-pool'  Hi, My... named 'webdriver-pool' How to remove the ModuleNotFoundError: No module named 'webdriver-pool' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'async-pool'
ModuleNotFoundError: No module named 'async-pool'  Hi, My Python... 'async-pool' How to remove the ModuleNotFoundError: No module named 'async-pool' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'hek-pool'
ModuleNotFoundError: No module named 'hek-pool'  Hi, My Python...-pool' How to remove the ModuleNotFoundError: No module named 'hek-pool... to install padas library. You can install hek-pool python with following
ModuleNotFoundError: No module named 'async-pool'
ModuleNotFoundError: No module named 'async-pool'  Hi, My Python... 'async-pool' How to remove the ModuleNotFoundError: No module named 'async-pool' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'host_pool'
ModuleNotFoundError: No module named 'host_pool'  Hi, My Python... 'host_pool' How to remove the ModuleNotFoundError: No module named 'host_pool' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'm-pool'
ModuleNotFoundError: No module named 'm-pool'  Hi, My Python...-pool' How to remove the ModuleNotFoundError: No module named 'm-pool'... to install padas library. You can install m-pool python with following command
ModuleNotFoundError: No module named 'pika-pool'
ModuleNotFoundError: No module named 'pika-pool'  Hi, My Python... 'pika-pool' How to remove the ModuleNotFoundError: No module named 'pika-pool' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'pymysql-pool'
ModuleNotFoundError: No module named 'pymysql-pool'  Hi, My Python... 'pymysql-pool' How to remove the ModuleNotFoundError: No module named 'pymysql-pool' error? Thanks   Hi, In your python

Ads