Fixed issue 0004425
authorStefan Hühner <stefan.huehner@openbravo.com>
Tue, 22 Jul 2008 07:42:35 +0000
changeset 1491 305365f56447
parent 1490 562e7577a63f
child 1492 1e5ba2186429
Fixed issue 0004425
Changed all OpenBravo spelling to Openbravo.
Only one place was left, the OpenBravoDriverManagerConnectionFactory class
src-core/src/org/openbravo/database/ConnectionPool.java
src-core/src/org/openbravo/database/ConnectionProviderImpl.java
src-core/src/org/openbravo/database/OpenBravoDriverManagerConnectionFactory.java
src-core/src/org/openbravo/database/OpenbravoDriverManagerConnectionFactory.java
--- a/src-core/src/org/openbravo/database/ConnectionPool.java	Mon Jul 21 16:30:42 2008 +0000
+++ b/src-core/src/org/openbravo/database/ConnectionPool.java	Tue Jul 22 07:42:35 2008 +0000
@@ -24,7 +24,7 @@
 import org.apache.commons.pool.KeyedObjectPoolFactory;
 import org.apache.commons.pool.impl.StackKeyedObjectPoolFactory;
 import org.apache.commons.pool.impl.GenericObjectPool;
-import org.openbravo.database.OpenBravoDriverManagerConnectionFactory;
+import org.openbravo.database.OpenbravoDriverManagerConnectionFactory;
 
 /**
  * ConnectionPool
@@ -69,7 +69,7 @@
     connectionPool.setTestWhileIdle(false);
 
     KeyedObjectPoolFactory keyedObject = new StackKeyedObjectPoolFactory();
-    ConnectionFactory connectionFactory = new OpenBravoDriverManagerConnectionFactory(_server, _login, _password, _dbSessionConfig);
+    ConnectionFactory connectionFactory = new OpenbravoDriverManagerConnectionFactory(_server, _login, _password, _dbSessionConfig);
     @SuppressWarnings("unused") //required by dbcp
 	PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,keyedObject, null,false,true);
 
--- a/src-core/src/org/openbravo/database/ConnectionProviderImpl.java	Mon Jul 21 16:30:42 2008 +0000
+++ b/src-core/src/org/openbravo/database/ConnectionProviderImpl.java	Tue Jul 22 07:42:35 2008 +0000
@@ -133,7 +133,7 @@
     connectionPool.setTestWhileIdle(false);
 
     KeyedObjectPoolFactory keyedObject = new StackKeyedObjectPoolFactory();
-    ConnectionFactory connectionFactory = new OpenBravoDriverManagerConnectionFactory(dbServer, dbLogin, dbPassword, dbSessionConfig);
+    ConnectionFactory connectionFactory = new OpenbravoDriverManagerConnectionFactory(dbServer, dbLogin, dbPassword, dbSessionConfig);
     @SuppressWarnings("unused") //required by dbcp
 	PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,keyedObject,null,false,true);
 
--- a/src-core/src/org/openbravo/database/OpenBravoDriverManagerConnectionFactory.java	Mon Jul 21 16:30:42 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- ************************************************************************************
- * Copyright (C) 2001-2006 Openbravo S.L.
- * Licensed under the Apache Software License version 2.0
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to  in writing,  software  distributed
- * under the License is distributed  on  an  "AS IS"  BASIS,  WITHOUT  WARRANTIES  OR
- * CONDITIONS OF ANY KIND, either  express  or  implied.  See  the  License  for  the
- * specific language governing permissions and limitations under the License.
- ************************************************************************************
-*/
-package org.openbravo.database;
-
-import java.sql.*;
-import java.util.Properties;
-import org.apache.commons.dbcp.*;
-
-public class OpenBravoDriverManagerConnectionFactory implements ConnectionFactory {
-  protected String _connectUri;
-  protected String _uname;
-  protected String _passwd;
-  protected Properties _props;
-  protected String _dbSessionConfig;
-
-  public OpenBravoDriverManagerConnectionFactory(String connectUri, Properties props) {
-    _connectUri = null;
-    _uname = null;
-    _passwd = null;
-    _props = null;
-    _connectUri = connectUri;
-    _props = props;
-  }
-
-  public OpenBravoDriverManagerConnectionFactory(String connectUri, String uname, String passwd, String dbSessionConfig) {
-    _connectUri = null;
-    _uname = null;
-    _passwd = null;
-    _props = null;
-    _dbSessionConfig = null;
-    _connectUri = connectUri;
-    _uname = uname;
-    _passwd = passwd;
-    _dbSessionConfig = dbSessionConfig;
-  }
-
-  public Connection createConnection() throws SQLException {
-    Connection conn = null;
-    if(null == _props) {
-      if(_uname == null)
-        conn = DriverManager.getConnection(_connectUri);
-      else
-        conn = DriverManager.getConnection(_connectUri, _uname, _passwd);
-    } else {
-      conn = DriverManager.getConnection(_connectUri, _props);
-    }
-    if (conn!=null && _dbSessionConfig!=null) executeDefaultSQL(conn);
-    return conn;
-  }
-
-  private void executeDefaultSQL(Connection conn) {
-    Statement stmt = null;
-    ResultSet rset = null;
-
-    try {
-      stmt = conn.createStatement();
-      if(!_dbSessionConfig.equals(""))
-    	  rset = stmt.executeQuery(_dbSessionConfig);
-    } catch(SQLException e) {
-      e.printStackTrace();
-    } finally {
-      try { rset.close(); } catch(Exception e) { }
-      try { stmt.close(); } catch(Exception e) { }
-      try { conn.commit(); } catch(Exception e) { }
-    }
-  }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-core/src/org/openbravo/database/OpenbravoDriverManagerConnectionFactory.java	Tue Jul 22 07:42:35 2008 +0000
@@ -0,0 +1,76 @@
+/*
+ ************************************************************************************
+ * Copyright (C) 2001-2006 Openbravo S.L.
+ * Licensed under the Apache Software License version 2.0
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to  in writing,  software  distributed
+ * under the License is distributed  on  an  "AS IS"  BASIS,  WITHOUT  WARRANTIES  OR
+ * CONDITIONS OF ANY KIND, either  express  or  implied.  See  the  License  for  the
+ * specific language governing permissions and limitations under the License.
+ ************************************************************************************
+*/
+package org.openbravo.database;
+
+import java.sql.*;
+import java.util.Properties;
+import org.apache.commons.dbcp.*;
+
+public class OpenbravoDriverManagerConnectionFactory implements ConnectionFactory {
+  protected String _connectUri;
+  protected String _uname;
+  protected String _passwd;
+  protected Properties _props;
+  protected String _dbSessionConfig;
+
+  public OpenbravoDriverManagerConnectionFactory(String connectUri, Properties props) {
+    _connectUri = null;
+    _uname = null;
+    _passwd = null;
+    _props = null;
+    _connectUri = connectUri;
+    _props = props;
+  }
+
+  public OpenbravoDriverManagerConnectionFactory(String connectUri, String uname, String passwd, String dbSessionConfig) {
+    _connectUri = null;
+    _uname = null;
+    _passwd = null;
+    _props = null;
+    _dbSessionConfig = null;
+    _connectUri = connectUri;
+    _uname = uname;
+    _passwd = passwd;
+    _dbSessionConfig = dbSessionConfig;
+  }
+
+  public Connection createConnection() throws SQLException {
+    Connection conn = null;
+    if(null == _props) {
+      if(_uname == null)
+        conn = DriverManager.getConnection(_connectUri);
+      else
+        conn = DriverManager.getConnection(_connectUri, _uname, _passwd);
+    } else {
+      conn = DriverManager.getConnection(_connectUri, _props);
+    }
+    if (conn!=null && _dbSessionConfig!=null) executeDefaultSQL(conn);
+    return conn;
+  }
+
+  private void executeDefaultSQL(Connection conn) {
+    Statement stmt = null;
+    ResultSet rset = null;
+
+    try {
+      stmt = conn.createStatement();
+      if(!_dbSessionConfig.equals(""))
+    	  rset = stmt.executeQuery(_dbSessionConfig);
+    } catch(SQLException e) {
+      e.printStackTrace();
+    } finally {
+      try { rset.close(); } catch(Exception e) { }
+      try { stmt.close(); } catch(Exception e) { }
+      try { conn.commit(); } catch(Exception e) { }
+    }
+  }
+}