Skip to content

Commit

Permalink
Work on README.md; get docJar working under Java 11 persnicketty tool…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
swaldman committed Feb 15, 2024
1 parent b24af8d commit 21eea09
Show file tree
Hide file tree
Showing 13 changed files with 111 additions and 90 deletions.
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
#### c3p0 ####
# c3p0

c3p0 is a mature, highly concurrent JDBC Connection pooling library, with
support for caching and reuse of PreparedStatements. It is licensed under
[LGPL v.2.1](https://github.com/swaldman/c3p0/blob/master/src/dist-static/LICENSE-LGPL)
or [EPL v.1.0](https://github.com/swaldman/c3p0/blob/master/src/dist-static/LICENSE-EPL),
[LGPL v.2.1](LICENSE-LGPL)
or [EPL v.1.0](LICENSE-EPL),
at your option.

c3p0 is now maintained on [github](https://github.com/swaldman/c3p0).

c3p0 is available as managed dependency on [Sonatype's open-source software repostory](https://oss.sonatype.org/content/repositories/releases/),
under <code>[groupId: com.mchange, artifactId: c3p0]</code> For available values of <code>version</code>, look [here](https://oss.sonatype.org/content/repositories/releases/com/mchange/c3p0/).

You can still find releases at [sourceforge](http://sourceforge.net/projects/c3p0/).
Documentation is [here](http://www.mchange.com/projects/c3p0/).

Documentation is available as part of every distribution, as well as [on-line](http://www.mchange.com/projects/c3p0/).

From the current *development snapshot*, here are the latest [CHANGELOG](https://github.com/swaldman/c3p0/blob/master/src/dist-static/CHANGELOG) and [RELEASE_NOTES](https://github.com/swaldman/c3p0/blob/master/src/dist-static/RELEASE_NOTES-c3p0-0.9.5). For information on how to build from src, checkout [README-SRC](https://github.com/swaldman/c3p0/blob/master/README-SRC).
From the current *development snapshot*, here are the latest [CHANGELOG](CHANGELOG)

Please address comments and questions to the [library author](mailto:swaldman@mchange.com), although keep in mind he is an abysmal correspondent and basically an asshole. Despite that, your feedback is very much appreciated. You may also open issues on github and/or sourceforge.

Thank you for your interest in c3p0. I do hope that you find it useful!

### Building c3p0

c3p0 relies on the excellent build tool [`mill`](https://mill-build.com/).

Install `mill`, then run

```plaintext
$ mill jar
```

You'll find the raw as library `out/out.jar`.

If you maintain a local ivy repository, You can customize `publishVersion` in [`build.sc`](build.sc), then run

```plaintext
$ mill publishLocal
```

---

**Note:** c3p0 has had a good experience with reporting of a security vulnerability via Sonatype's _Central Security Project_.
Expand Down
3 changes: 2 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,14 @@ object c3p0 extends RootModule with JavaModule with PublishModule {
}
}

val organization = "com.mchange"
override def artifactName = T{"c3p0"}
override def publishVersion = T{"0.10.0-pre1-SNAPSHOT"}

override def pomSettings = T {
PomSettings(
description = "A mature JDBC3+ Connection pooling library",
organization = "com.mchange",
organization = organization,
url = "https://www.mchange.com/projects/c3p0",
licenses = Seq(License.`LGPL-2.1-only`,License.`EPL-1.0`),
versionControl = VersionControl.github("swaldman", "c3p0"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ public interface C3P0ProxyConnection extends Connection
* retrieved from a c3p0 PooledDataSource to a
* C3P0ProxyConnection.</p>
*
* <p>This method works by making a reflective call of method <tt>m</tt> on
* Object <tt>target</tt> (which may be null for static methods), passing
* and argument list <tt>args</tt>. For the method target, or for any argument,
* you may substitute the special token <tt>C3P0ProxyConnection.RAW_CONNECTION</tt></p>
* <p>This method works by making a reflective call of method <code>m</code> on
* Object <code>target</code> (which may be null for static methods), passing
* and argument list <code>args</code>. For the method target, or for any argument,
* you may substitute the special token <code>C3P0ProxyConnection.RAW_CONNECTION</code></p>
*
* <p>Any Statements or ResultSets returned by the operation will be proxied
* and c3p0-managed, meaning that these resources will be automatically closed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ public interface C3P0ProxyStatement extends Statement
* retrieved from a c3p0-provided Connection to a
* C3P0ProxyStatement.</p>
*
* <p>This method works by making a reflective call of method <tt>m</tt> on
* Object <tt>target</tt> (which may be null for static methods), passing
* and argument list <tt>args</tt>. For the method target, or for any argument,
* you may substitute the special token <tt>C3P0ProxyStatement.RAW_STATEMENT</tt></p>
* <p>This method works by making a reflective call of method <code>m</code> on
* Object <code>target</code> (which may be null for static methods), passing
* and argument list <code>args</code>. For the method target, or for any argument,
* you may substitute the special token <code>C3P0ProxyStatement.RAW_STATEMENT</code></p>
*
* <p>Any ResultSets returned by the operation will be proxied
* and c3p0-managed, meaning that these resources will be automatically closed
Expand Down
22 changes: 12 additions & 10 deletions src/com/mchange/v2/c3p0/AbstractConnectionTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,31 @@
*
* <ol>
* <li>Extend {@link com.mchange.v2.c3p0.AbstractConnectionTester}</li>
* <li>Override only the two abstract methods</li>
* <ul>
* <li><tt>public int activeCheckConnection(Connection c, String preferredTestQuery, Throwable[] rootCauseOutParamHolder)</tt></li>
* <li><tt>public int statusOnException(Connection c, Throwable t, String preferredTestQuery, Throwable[] rootCauseOutParamHolder)</tt></li>
* </ul>
* <li>Take care to ensure that your methods are defined to allow <tt>preferredTestQuery</tt> and
* <tt>rootCauseOutParamHolder</tt> to be <tt>null</tt>.</li>
* <li>
* Override only the two abstract methods
* <ul>
* <li><code>public int activeCheckConnection(Connection c, String preferredTestQuery, Throwable[] rootCauseOutParamHolder)</code></li>
* <li><code>public int statusOnException(Connection c, Throwable t, String preferredTestQuery, Throwable[] rootCauseOutParamHolder)</code></li>
* </ul>
* </li>
* <li>Take care to ensure that your methods are defined to allow <code>preferredTestQuery</code> and
* <code>rootCauseOutParamHolder</code> to be <code>null</code>.</li>
* </ol>
*
* <p>Parameter <tt>rootCauseOutParamHolder</tt> is an optional parameter, which if supplied, will be a Throwable array whose size
* <p>Parameter <code>rootCauseOutParamHolder</code> is an optional parameter, which if supplied, will be a Throwable array whose size
* it at least one. If a Connection test fails because of some Exception, the Connection tester may set this Exception as the
* zero-th element of the array to provide information about why and how the test failed.</p>
*/
public abstract class AbstractConnectionTester implements UnifiedConnectionTester
{
/**
* Override, but remember that <tt>preferredTestQuery</tt> and <tt>rootCauseOutParamHolder</tt>
* Override, but remember that <code>preferredTestQuery</code> and <code>rootCauseOutParamHolder</code>
* can be null.
*/
public abstract int activeCheckConnection(Connection c, String preferredTestQuery, Throwable[] rootCauseOutParamHolder);

/**
* Override, but remember that <tt>preferredTestQuery</tt> and <tt>rootCauseOutParamHolder</tt>
* Override, but remember that <code>preferredTestQuery</code> and <code>rootCauseOutParamHolder</code>
* can be null.
*/
public abstract int statusOnException(Connection c, Throwable t, String preferredTestQuery, Throwable[] rootCauseOutParamHolder);
Expand Down
4 changes: 2 additions & 2 deletions src/com/mchange/v2/c3p0/C3P0Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ public synchronized static Set pooledDataSourcesByName( String dataSourceName )
}

/**
* <b>Note:</b> If multiple PooledDataSources in your JVM share the same <tt>dataSourceName</tt>, which of those
* <b>Note:</b> If multiple PooledDataSources in your JVM share the same <code>dataSourceName</code>, which of those
* multiple DataSources will be returned by this method is undefined!
*
* @return a PooledDataSource with the given <tt>dataSourceName</tt>, if at least one exists. <tt>null</tt> otherwise.
* @return a PooledDataSource with the given <code>dataSourceName</code>, if at least one exists. <code>null</code> otherwise.
*
*/
public synchronized static PooledDataSource pooledDataSourceByName( String dataSourceName )
Expand Down
2 changes: 1 addition & 1 deletion src/com/mchange/v2/c3p0/ConnectionTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* of Connections and responding to Connection errors encountered.</p>
*
* <p><b>Recommended:</b> If you'd like your ConnectionTester
* to support the user-configured <tt>preferredTestQuery</tt>
* to support the user-configured <code>preferredTestQuery</code>
* parameter, please implement {@link com.mchange.v2.c3p0.UnifiedConnectionTester}.
*
* <p>ConnectionTesters should be Serializable, immutable,
Expand Down
8 changes: 4 additions & 4 deletions src/com/mchange/v2/c3p0/DataSources.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@
import com.mchange.v2.beans.BeansUtils;

/**
* <p>A simple factory class for creating DataSources. Generally, users will call <tt>DataSources.unpooledDataSource()</tt> to get
* a basic DataSource, and then get a pooled version by calling <tt>DataSources.pooledDataSource()</tt>.</p>
* <p>A simple factory class for creating DataSources. Generally, users will call <code>DataSources.unpooledDataSource()</code> to get
* a basic DataSource, and then get a pooled version by calling <code>DataSources.pooledDataSource()</code>.</p>
*
* <p>Most users will not need to worry about configuration details. If you want to use a PreparedStatement cache, be sure to call
* the version of <tt>DataSources.pooledDataSource()</tt> that accepts a <tt>statement_cache_size</tt> parameter, and set that to
* the version of <code>DataSources.pooledDataSource()</code> that accepts a <code>statement_cache_size</code> parameter, and set that to
* be a number (much) greater than zero. (For maximum performance, you would set this to be several times the number kinds of
* PreparedStatements you expect your application to use.)</p>
*
* <p>For those interested in detailed configuration, note that c3p0 pools can be configured by explicit method calls on PoolConfig objects,
* by defining System properties, or by defining a <tt>c3p0.properties</tt> file in your resource path. See {@link com.mchange.v2.c3p0.PoolConfig}
* by defining System properties, or by defining a <code>c3p0.properties</code> file in your resource path. See {@link com.mchange.v2.c3p0.PoolConfig}
* for details.</p>
*
*/
Expand Down
20 changes: 10 additions & 10 deletions src/com/mchange/v2/c3p0/DriverManagerDataSourceFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
public final class DriverManagerDataSourceFactory
{
/**
* Creates an unpooled DataSource that users <TT>java.sql.DriverManager</TT>
* Creates an unpooled DataSource that users <code>java.sql.DriverManager</code>
* behind the scenes to acquire Connections.
*
* @param driverClass a jdbc driver class that can resolve <TT>jdbcUrl</TT>.
* @param driverClass a jdbc driver class that can resolve <code>jdbcUrl</code>.
* @param jdbcUrl the jdbcUrl of the RDBMS that Connections should be made to.
* @param dfltUser a username (may be null) for authentication to the RDBMS
* @param dfltPassword a password (may be null) for authentication to the RDBMS
Expand All @@ -80,10 +80,10 @@ public static DataSource create(String driverClass,
}

/**
* Creates an unpooled DataSource that users <TT>java.sql.DriverManager</TT>
* Creates an unpooled DataSource that users <code>java.sql.DriverManager</code>
* behind the scenes to acquire Connections.
*
* @param driverClass a jdbc driver class that can resolve <TT>jdbcUrl</TT>.
* @param driverClass a jdbc driver class that can resolve <code>jdbcUrl</code>.
* @param jdbcUrl the jdbcUrl of the RDBMS that Connections should be made to.
* @param props propertis object that should be passed to DriverManager.getConnection()
* @param refFactoryLoc a codebase url where JNDI clients can find the
Expand All @@ -105,10 +105,10 @@ public static DataSource create(String driverClass,
}

/**
* Creates an unpooled DataSource that users <TT>java.sql.DriverManager</TT>
* Creates an unpooled DataSource that users <code>java.sql.DriverManager</code>
* behind the scenes to acquire Connections.
*
* @param driverClass a jdbc driver class that can resolve <TT>jdbcUrl</TT>.
* @param driverClass a jdbc driver class that can resolve <code>jdbcUrl</code>.
* @param jdbcUrl the jdbcUrl of the RDBMS that Connections should be made to.
* @param dfltUser a username (may be null) for authentication to the RDBMS
* @param dfltPassword a password (may be null) for authentication to the RDBMS
Expand All @@ -121,18 +121,18 @@ public static DataSource create(String driverClass,
{ return create( driverClass, jdbcUrl, dfltUser, dfltPassword, null ); }

/**
* Creates an unpooled DataSource that users <TT>java.sql.DriverManager</TT>
* Creates an unpooled DataSource that users <code>java.sql.DriverManager</code>
* behind the scenes to acquire Connections.
*
* @param driverClass a jdbc driver class that can resolve <TT>jdbcUrl</TT>.
* @param driverClass a jdbc driver class that can resolve <code>jdbcUrl</code>.
* @param jdbcUrl the jdbcUrl of the RDBMS that Connections should be made to.
*/
public static DataSource create(String driverClass, String jdbcUrl)
throws SQLException
{ return DriverManagerDataSourceFactory.create( driverClass, jdbcUrl, (String) null, null); }

/**
* Creates an unpooled DataSource that users <TT>java.sql.DriverManager</TT>
* Creates an unpooled DataSource that users <code>java.sql.DriverManager</code>
* behind the scenes to acquire Connections.
*
* <P>Warning: since you do not set the driver class, the resulting DataSource
Expand All @@ -148,7 +148,7 @@ public static DataSource create(String jdbcUrl, String dfltUser, String dfltPass
{ return DriverManagerDataSourceFactory.create( null, jdbcUrl, dfltUser, dfltPassword ); }

/**
* Creates an unpooled DataSource that users <TT>java.sql.DriverManager</TT>
* Creates an unpooled DataSource that users <code>java.sql.DriverManager</code>
* behind the scenes to acquire Connections.
*
* <P>Warning: since you do not set the driver class, the resulting DataSource
Expand Down

0 comments on commit 21eea09

Please sign in to comment.