Author: arminw
Date: Fri Dec 22 17:16:54 2006
New Revision: 489813
URL: http://svn.apache.org/viewvc?view=rev&rev=489813
Log:
change Platform instance lookup
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryAbstractImpl.java
Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryAbstractImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryAbstractImpl.java?view=diff&rev=489813&r1=489812&r2=489813
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryAbstractImpl.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryAbstractImpl.java Fri Dec 22 17:16:54 2006
@@ -15,13 +15,6 @@
* limitations under the License.
*/
-import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor;
-import org.apache.ojb.broker.platforms.PlatformException;
-import org.apache.ojb.broker.platforms.PlatformFactory;
-import org.apache.ojb.broker.util.ClassHelper;
-import org.apache.ojb.broker.util.logging.Logger;
-import org.apache.ojb.broker.util.logging.LoggerFactory;
-
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
@@ -32,6 +25,12 @@
import java.util.Map;
import java.util.Properties;
+import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor;
+import org.apache.ojb.broker.platforms.PlatformException;
+import org.apache.ojb.broker.util.ClassHelper;
+import org.apache.ojb.broker.util.logging.Logger;
+import org.apache.ojb.broker.util.logging.LoggerFactory;
+
/**
* Abstract base class to simplify implementation of {@link ConnectionFactory}'s.
*
@@ -46,7 +45,7 @@
* holds the datasource looked up from JNDI in a map, keyed
* by the JNDI name.
*/
- private Map dataSourceCache = new HashMap();
+ private final Map dataSourceCache = new HashMap();
/**
* Returns a valid JDBC Connection. Implement this method in concrete subclasses.
@@ -155,7 +154,7 @@
{
try
{
- PlatformFactory.getPlatformFor(jcd).initializeJdbcConnection(jcd, con);
+ jcd.getPlatform().initializeJdbcConnection(con);
}
catch (PlatformException e)
{
@@ -186,7 +185,7 @@
protected Connection newConnectionFromDataSource(JdbcConnectionDescriptor jcd)
throws LookupException
{
- Connection retval = null;
+ Connection retval;
// use JNDI lookup
DataSource ds = jcd.getDataSource();
@@ -252,7 +251,7 @@
protected Connection newConnectionFromDriverManager(JdbcConnectionDescriptor jcd)
throws LookupException
{
- Connection retval = null;
+ Connection retval;
// use JDBC DriverManager
final String driver = jcd.getDriver();
final String url = getDbURL(jcd);
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.