Skip to content

Instantly share code, notes, and snippets.

@takezoux2
Created June 12, 2012 15:21
Show Gist options
  • Save takezoux2/2918162 to your computer and use it in GitHub Desktop.
Save takezoux2/2918162 to your computer and use it in GitHub Desktop.
simplest java.sql.Connection wrapper for scala
import java.sql.{Savepoint, Connection}
import java.util.{Properties, Map}
import java.util.concurrent.Executor
class ConnectionWrapper(connection : Connection) extends Connection{
def setReadOnly(v0 : Boolean) = connection.setReadOnly(v0)
def close() = connection.close()
def isValid(v0 : Int) = connection.isValid(v0)
def isReadOnly() = connection.isReadOnly()
// def abort(v0 : Executor) = connection.abort(v0)
def clearWarnings() = connection.clearWarnings()
// def createArrayOf(v0 : String, v1 : Array[AnyRef]) = connection.createArrayOf(v0, v1)
def createStatement(v0 : Int, v1 : Int, v2 : Int) = connection.createStatement(v0, v1, v2)
def createStatement(v0 : Int, v1 : Int) = connection.createStatement(v0, v1)
def createStatement() = connection.createStatement()
def getAutoCommit() = connection.getAutoCommit()
def getClientInfo(v0 : String) = connection.getClientInfo(v0)
def getClientInfo() = connection.getClientInfo()
def getHoldability() = connection.getHoldability()
// def getNetworkTimeout() = connection.getNetworkTimeout()
def getTransactionIsolation() = connection.getTransactionIsolation()
def prepareStatement(v0 : String, v1 : Int, v2 : Int, v3 : Int) = connection.prepareStatement(v0, v1, v2, v3)
def prepareStatement(v0 : String) = connection.prepareStatement(v0)
// def prepareStatement(v0 : String, v1 : Array[Int]) = connection.prepareStatement(v0, v1)
def prepareStatement(v0 : String, v1 : Int, v2 : Int) = connection.prepareStatement(v0, v1, v2)
// def prepareStatement(v0 : String, v1 : Array[String]) = connection.prepareStatement(v0, v1)
def prepareStatement(v0 : String, v1 : Int) = connection.prepareStatement(v0, v1)
def releaseSavepoint(v0 : Savepoint) = connection.releaseSavepoint(v0)
def setAutoCommit(v0 : Boolean) = connection.setAutoCommit(v0)
def setClientInfo(v0 : String, v1 : String) = connection.setClientInfo(v0, v1)
def setClientInfo(v0 : Properties) = connection.setClientInfo(v0)
def setHoldability(v0 : Int) = connection.setHoldability(v0)
// def setNetworkTimeout(v0 : Executor, v1 : Int) = connection.setNetworkTimeout(v0, v1)
def setTransactionIsolation(v0 : Int) = connection.setTransactionIsolation(v0)
def isClosed() = connection.isClosed()
def createClob() = connection.createClob()
def createBlob() = connection.createBlob()
def getCatalog() = connection.getCatalog()
// def createStruct(v0 : String, v1 : Array[AnyRef]) = connection.createStruct(v0, v1)
// def getSchema() = connection.getSchema()
def createSQLXML() = connection.createSQLXML()
def createNClob() = connection.createNClob()
def commit() = connection.commit()
def getMetaData() = connection.getMetaData()
def getWarnings() = connection.getWarnings()
def getTypeMap() = connection.getTypeMap()
def prepareCall(v0 : String) = connection.prepareCall(v0)
def prepareCall(v0 : String, v1 : Int, v2 : Int, v3 : Int) = connection.prepareCall(v0, v1, v2, v3)
def prepareCall(v0 : String, v1 : Int, v2 : Int) = connection.prepareCall(v0, v1, v2)
def nativeSQL(v0 : String) = connection.nativeSQL(v0)
def setCatalog(v0 : String) = connection.setCatalog(v0)
def rollback() = connection.rollback()
def rollback(v0 : Savepoint) = connection.rollback(v0)
// def setSchema(v0 : String) = connection.setSchema(v0)
def setSavepoint(v0 : String) = connection.setSavepoint(v0)
def setSavepoint() = connection.setSavepoint()
def setTypeMap(v0 : Map[String,Class[_]]) = connection.setTypeMap(v0)
def unwrap[T](v0 : Class[T]) = connection.unwrap(v0)
def isWrapperFor(v0 : Class[_]) = connection.isWrapperFor(v0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment