summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.persistence.adapter.jdbc/src/main/java/net/wotonomy/jdbcadaptor/JDBCContext.java
diff options
context:
space:
mode:
authorBenjamin Culkin <scorpress@gmail.com>2024-05-20 17:58:16 -0400
committerBenjamin Culkin <scorpress@gmail.com>2024-05-20 17:58:16 -0400
commit40a9d99496e098562f090fb7ffce9e749011b131 (patch)
tree437df24d65470582e943e494a52db8ed65a881ae /projects/net.wotonomy.persistence.adapter.jdbc/src/main/java/net/wotonomy/jdbcadaptor/JDBCContext.java
parentff072dfe782f6f22123cd4ba050828d35c0d0fbd (diff)
Formatting pass
Diffstat (limited to 'projects/net.wotonomy.persistence.adapter.jdbc/src/main/java/net/wotonomy/jdbcadaptor/JDBCContext.java')
-rw-r--r--projects/net.wotonomy.persistence.adapter.jdbc/src/main/java/net/wotonomy/jdbcadaptor/JDBCContext.java56
1 files changed, 33 insertions, 23 deletions
diff --git a/projects/net.wotonomy.persistence.adapter.jdbc/src/main/java/net/wotonomy/jdbcadaptor/JDBCContext.java b/projects/net.wotonomy.persistence.adapter.jdbc/src/main/java/net/wotonomy/jdbcadaptor/JDBCContext.java
index 445ffb5..9e6df6c 100644
--- a/projects/net.wotonomy.persistence.adapter.jdbc/src/main/java/net/wotonomy/jdbcadaptor/JDBCContext.java
+++ b/projects/net.wotonomy.persistence.adapter.jdbc/src/main/java/net/wotonomy/jdbcadaptor/JDBCContext.java
@@ -27,18 +27,19 @@ import net.wotonomy.access.EOAdaptorChannel;
import net.wotonomy.access.EOAdaptorContext;
/**
-* Concrete implementation of EOAdaptorContext for use with JDBC.
-*
-* @author ezamudio@nasoft.com
-* @author $Author: cgruber $
-* @version $Revision: 903 $
-*/
+ * Concrete implementation of EOAdaptorContext for use with JDBC.
+ *
+ * @author ezamudio@nasoft.com
+ * @author $Author: cgruber $
+ * @version $Revision: 903 $
+ */
public class JDBCContext extends EOAdaptorContext {
protected Connection _jdbcConnection;
/**
* Creates a new instance.
+ *
* @param adaptor The adaptor this context belongs to.
*/
public JDBCContext(EOAdaptor adaptor) {
@@ -49,12 +50,12 @@ public class JDBCContext extends EOAdaptorContext {
try {
if (_jdbcConnection != null && !_jdbcConnection.isClosed())
throw new JDBCAdaptorException("Attempt to connect when already connected.", null);
- Class.forName(((JDBCAdaptor)adaptor()).driverName());
- String url = (String)adaptor().connectionDictionary().objectForKey("URL");
+ Class.forName(((JDBCAdaptor) adaptor()).driverName());
+ String url = (String) adaptor().connectionDictionary().objectForKey("URL");
Driver driver = DriverManager.getDriver(url);
java.util.Properties props = new java.util.Properties();
- props.setProperty("user", (String)adaptor().connectionDictionary().objectForKey("username"));
- props.setProperty("password", (String)adaptor().connectionDictionary().objectForKey("password"));
+ props.setProperty("user", (String) adaptor().connectionDictionary().objectForKey("username"));
+ props.setProperty("password", (String) adaptor().connectionDictionary().objectForKey("password"));
_jdbcConnection = driver.connect(url, props);
_jdbcConnection.setAutoCommit(false);
} catch (SQLException ex) {
@@ -80,8 +81,9 @@ public class JDBCContext extends EOAdaptorContext {
return _jdbcConnection;
}
- /* Begins a transaction. Actually it does nothing because it's not
- * necessary.
+ /*
+ * Begins a transaction. Actually it does nothing because it's not necessary.
+ *
* @see net.wotonomy.access.EOAdaptorContext#beginTransaction()
*/
public void beginTransaction() {
@@ -90,7 +92,9 @@ public class JDBCContext extends EOAdaptorContext {
transactionDidBegin();
}
- /* Commits a transaction.
+ /*
+ * Commits a transaction.
+ *
* @see net.wotonomy.access.EOAdaptorContext#commitTransaction()
*/
public void commitTransaction() {
@@ -102,7 +106,9 @@ public class JDBCContext extends EOAdaptorContext {
}
}
- /* Rolls back a transacion.
+ /*
+ * Rolls back a transacion.
+ *
* @see net.wotonomy.access.EOAdaptorContext#rollbackTransaction()
*/
public void rollbackTransaction() {
@@ -114,7 +120,9 @@ public class JDBCContext extends EOAdaptorContext {
}
}
- /* Creates a JDBCChannel instance.
+ /*
+ * Creates a JDBCChannel instance.
+ *
* @see net.wotonomy.access.EOAdaptorContext#createAdaptorChannel()
*/
public EOAdaptorChannel createAdaptorChannel() {
@@ -123,7 +131,9 @@ public class JDBCContext extends EOAdaptorContext {
return channel;
}
- /* I don't know what to do here. Throw something, maybe?
+ /*
+ * I don't know what to do here. Throw something, maybe?
+ *
* @see net.wotonomy.access.EOAdaptorContext#handleDroppedConnection()
*/
public void handleDroppedConnection() {
@@ -133,14 +143,14 @@ public class JDBCContext extends EOAdaptorContext {
}
/*
- * $Log$
- * Revision 1.2 2006/02/18 22:59:22 cgruber
- * make it compile with maven dependencies and add a cvsignore.
+ * $Log$ Revision 1.2 2006/02/18 22:59:22 cgruber make it compile with maven
+ * dependencies and add a cvsignore.
*
- * Revision 1.1 2006/02/16 13:22:23 cgruber
- * Check in all sources in eclipse-friendly maven-enabled packages.
+ * Revision 1.1 2006/02/16 13:22:23 cgruber Check in all sources in
+ * eclipse-friendly maven-enabled packages.
*
- * Revision 1.1 2003/08/13 20:13:33 chochos
- * concrete implementation of EOAdaptorContext for use with JDBC. This is the class that holds the physical connection to the database.
+ * Revision 1.1 2003/08/13 20:13:33 chochos concrete implementation of
+ * EOAdaptorContext for use with JDBC. This is the class that holds the physical
+ * connection to the database.
*
*/