如何在grails dataSource.config中为oracle数据库编写Url代码

时间:2014-12-22 13:56:51

标签: oracle grails

我正在尝试从grails连接到oracle 10gXE。 在网上我只找到localhost的网址: url =“jdbc:oracle:thin:@localhost:1521:XE” 但我需要连接到本地网络中的主机 我可以使用ping 192.168.2.128

成功ping通

但 url =“jdbc:oracle:thin:@ 192.168.2.128:1521:XE” 最终:

Error 2014-12-22 14:26:23,612 [localhost-startStop-1] ERROR pool.ConnectionPool  - Unable to create initial connections of pool. 
Message: E/A-Exception: The Network Adapter could not establish the connection   
 Line | Method


->>  112 | throwSqlException in oracle.jdbc.driver.DatabaseError
|    146 | throwSqlException in     ''
|    255 | throwSqlException in     ''
|    387 | logon             in oracle.jdbc.driver.T4CConnection
|    414 | <init> . . . . .  in oracle.jdbc.driver.PhysicalConnection
|    165 | <init>            in oracle.jdbc.driver.T4CConnection
|     35 | getConnection . . in oracle.jdbc.driver.T4CDriverExtension    
|    801 | connect           in oracle.jdbc.driver.OracleDriver    
|    262 | run . . . . . . . in java.util.concurrent.FutureTask    
|   1145 | runWorker         in java.util.concurrent.ThreadPoolExecutor    
|    615 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker   
^    745 | run               in java.lang.Thread     

彼得 多特蒙德德国

PS。 我完整的数据来源:

dataSource {
pooled = true
driverClassName = "oracle.jdbc.OracleDriver"
dialect = "org.hibernate.dialect.Oracle10gDialect"
username = "peter"
password = "wuffwuff"

}

environments {
development {
    dataSource {
        dbCreate = "update" // one of 'create', 'create-drop','update'
        url = "jdbc:oracle:thin:@192.168.2.128:1521:XE"
    }
}
test {
    dataSource {
        dbCreate = "update"
        url = "jdbc:oracle:thin:@192.168.2.128:1521:XE"
    }
}
production {
    dataSource {
        dbCreate = "update"
        url = "jdbc:oracle:thin:@192.168.2.128:1521:XE"
        username = "peter"
        password = "wuffwuff"
    }
}

}

0 个答案:

没有答案