资源简介
c3p0-0.9.1.2 里面包括c3p0-0.9.1.2的jar包和 说明文档
代码片段和文件信息
import java.sql.*;
import javax.naming.*;
import javax.sql.DataSource;
import com.mchange.v2.c3p0.DataSources;
/**
* This example shows how to acquire a c3p0 DataSource and
* bind it to a JNDI name service.
*/
public final class JndiBindDataSource
{
// be sure to load your database driver class either via
// Class.forName() [as shown below] or externally (e.g. by
// using -Djdbc.drivers when starting your JVM).
static
{
try
{ Class.forName( “org.postgresql.Driver“ ); }
catch (Exception e)
{ e.printStackTrace(); }
}
public static void main(String[] argv)
{
try
{
// let a command line arg specify the name we will
// bind our DataSource to.
String jndiName = argv[0];
// acquire the DataSource using default pool params...
// this is the only c3p0 specific code here
DataSource unpooled = DataSources.unpooledDataSource(“jdbc:postgresql://localhost/test“
“swaldman“
“test“);
DataSource pooled = DataSources.pooledDataSource( unpooled );
// Create an InitialContext and bind the DataSource to it in
// the usual way.
//
// We are using the no-arg version of InitialContext‘s constructor
// therefore the jndi environment must be first set via a jndi.properties
// file System properties or by some other means.
InitialContext ctx = new InitialContext();
ctx.rebind( jndiName pooled );
System.out.println(“DataSource bound to nameservice under the name \““ +
jndiName + ‘\“‘);
}
catch (Exception e)
{ e.printStackTrace(); }
}
static void attemptClose(ResultSet o)
{
try
{ if (o != null) o.close();}
catch (Exception e)
{ e.printStackTrace();}
}
static void attemptClose(Statement o)
{
try
{ if (o != null) o.close();}
catch (Exception e)
{ e.printStackTrace();}
}
static void attemptClose(Connection o)
{
try
{ if (o != null) o.close();}
catch (Exception e)
{ e.printStackTrace();}
}
private JndiBindDataSource()
{}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\
文件 79238 2007-05-22 03:05 c3p0-0.9.1.2\CHANGELOG
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs\
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs-oracle-thin\
文件 746 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\allclasses-fr
文件 726 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\allclasses-nofr
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs-oracle-thin\com\
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs-oracle-thin\com\mchange\
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs-oracle-thin\com\mchange\v2\
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs-oracle-thin\com\mchange\v2\c3p0\
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs-oracle-thin\com\mchange\v2\c3p0\dbms\
文件 10586 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\com\mchange\v2\c3p0\dbms\OracleUtils.html
文件 972 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\com\mchange\v2\c3p0\dbms\package-fr
文件 5703 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\com\mchange\v2\c3p0\dbms\package-summary.html
文件 5269 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\com\mchange\v2\c3p0\dbms\package-tree.html
文件 4830 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\constant-values.html
文件 4766 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\deprecated-list.html
文件 8586 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\help-doc.html
文件 6225 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\index-all.html
文件 1252 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\index.html
文件 5044 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\overview-tree.html
文件 25 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\package-list
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs-oracle-thin\resources\
文件 57 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\resources\inherit.gif
文件 1202 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs-oracle-thin\st
文件 3717 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs\allclasses-fr
文件 3297 2007-05-22 03:05 c3p0-0.9.1.2\doc\apidocs\allclasses-nofr
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs\com\
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs\com\mchange\
目录 0 2018-07-28 23:14 c3p0-0.9.1.2\doc\apidocs\com\mchange\v2\
............此处省略53个文件信息
评论
共有 条评论