0
我在Eclipse中有一個Dynamic Web Project,並且正嘗試通過JDBC連接到Oracle 11g Release 2 Express Edition。但我得到的錯誤,出現以下消息:由於IO錯誤導致與Oracle 11g XE連接失敗:網絡適配器無法建立連接
Could not connect to Oracle 11g XE Conn.
Error creating SQL Model Connection connection to Oracle 11g XE Conn. (Error: IO Error: The Network Adapter could not establish the connection)
IO Error: The Network Adapter could not establish the connection
Error creating JDBC Connection connection to Oracle 11g XE Conn. (Error: IO Error: The Network Adapter could not establish the connection)
IO Error: The Network Adapter could not establish the connection
要添加,因爲我使用Apache Tomcat 6.0.35,我已經加入了資源和ResourceParams(對於我試圖訪問的數據庫)中 \ conf的server.xml文件。
<Resource name="jdbc/FlightDB" scope="Shareable" type="javax.sql.DataSource"
auth="Container" description="Home Oracle 11g Express Edition"/>
<ResourceParams name="jdbc/FlightDB">
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@server:1521:flightDB</value>
</parameter>
<parameter>
<name>username</name>
<value>system</value>
</parameter>
<parameter>
<name>password</name>
<value></value>
</parameter>
</ResourceParams>
此外,我在我的當前Web應用程序的web.xml中添加了resource-ref元素。
<resource-ref>
<res-ref-name>jdbc/FlightDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
但是,隨着問題再次出現,這沒有幫助。
任何幫助將不勝感激。期待回覆。
感謝,
索姆納特
好的非常感謝。有效。 – somnathchakrabarti 2012-04-24 14:58:53