So, I have something like this in my boot.scala:
object DBVendor extends ConnectionManager {
def newConnection(name: ConnectionIdentifier): Box[Connection] = {
try {
Class.forName("oracle.jdbc.driver.OracleDriver")
val dm = DriverManager.getConnection("jdbc:oracle:thin:@hostname:1521:orcl", "username", "password");
Full(dm)
} catch {
case e : Exception => e.printStackTrace; Empty
}
}
def releaseConnection(conn: Connection) {conn.close}
}
A few quick questions I have ... How do I configure a driver to connect?
@hostname from what I see is for local databases, but my remote ... I have all the information to connect to it through the sqldeveloper that I use, and assumed that all I need is a host name. Is the hostname all I need there, if that's all I need? or will I need some kind of absolute address?
source
share