diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-13 01:41:50 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-13 01:41:50 +0000 |
commit | aca1633212fe261c04861cd48ab53b5081089fd2 (patch) | |
tree | 41f9e8fa66e1b78204ae15071fd611d7205877a1 /sandbox/lresende/backup/organization-das/src/main/java/util/ConnectionHelper.java | |
parent | 8eb5bf1de6c82c6d6e2932630be767aaa086a2b8 (diff) |
Cleaning up sandbox
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@898604 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/lresende/backup/organization-das/src/main/java/util/ConnectionHelper.java')
-rw-r--r-- | sandbox/lresende/backup/organization-das/src/main/java/util/ConnectionHelper.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sandbox/lresende/backup/organization-das/src/main/java/util/ConnectionHelper.java b/sandbox/lresende/backup/organization-das/src/main/java/util/ConnectionHelper.java new file mode 100644 index 0000000000..43903b3a11 --- /dev/null +++ b/sandbox/lresende/backup/organization-das/src/main/java/util/ConnectionHelper.java @@ -0,0 +1,28 @@ +package util; + +import java.sql.Connection; +import java.sql.DriverManager; + +import org.soa.types.SchemaInfoType; + +public class ConnectionHelper { + public static java.sql.Connection getConnection(SchemaInfoType schemaInfo) + { + Connection conn = null; + + // schemaInfo should be your SID. Something like xe (for Oracle Personal Edition) + String url = "jdbc:derby:target/organization_db; create = true"; + String driver = "org.apache.derby.jdbc.EmbeddedDriver"; + + try { + Class.forName(driver); + conn = DriverManager.getConnection(url, schemaInfo.getUSERNAME(), schemaInfo.getPASSWORD()); + conn.setAutoCommit(false); + } + catch (Exception e) { + e.printStackTrace(); + } + + return conn; + } +} |