diff options
Diffstat (limited to 'org.eclipse.osee.framework.postgresql/src/org/eclipse/osee/framework/postgresql/PostgresqlConnection.java')
-rw-r--r-- | org.eclipse.osee.framework.postgresql/src/org/eclipse/osee/framework/postgresql/PostgresqlConnection.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/org.eclipse.osee.framework.postgresql/src/org/eclipse/osee/framework/postgresql/PostgresqlConnection.java b/org.eclipse.osee.framework.postgresql/src/org/eclipse/osee/framework/postgresql/PostgresqlConnection.java new file mode 100644 index 00000000000..bb19f639216 --- /dev/null +++ b/org.eclipse.osee.framework.postgresql/src/org/eclipse/osee/framework/postgresql/PostgresqlConnection.java @@ -0,0 +1,39 @@ +/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.postgresql;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
+import org.eclipse.osee.framework.db.connection.IConnection;
+
+public class PostgresqlConnection implements IConnection {
+
+ private static final String driverName = "org.postgresql.Driver";
+
+ public PostgresqlConnection() {
+ }
+
+ public Connection getConnection(Properties properties, String connectionURL) throws ClassNotFoundException, SQLException {
+ Class.forName(driverName);
+ Connection connection = DriverManager.getConnection(connectionURL, properties);
+ return connection;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.db.connection.IConnection#getDriver()
+ */
+ @Override
+ public String getDriver() {
+ return driverName;
+ }
+}
|