简体   繁体   中英

Can not connect oracle 10g personal edition r2 database using JDBC

i tried to perform connection test on netbeans as by creating new connection from databases node.

i am trying to connect with ojdbc6.jar driver and my sid of databse is orcl (oracle personal edition).

while creating new connection i did locate the oracle thin driver, used port 1521 , i am using hr user which i have unlocked previously, the connection string of my connection is jdbc:oracle:thin:@localhost:1521:orcl but when i perform testing it throws message

Cannot establish a connection to jdbc:oracle:thin:@localhost:1521:orcl using oracle.jdbc.OracleDriver (IO Error: The Network Adapter could not establish the connection),

need help ,thanks in advance !

首先,您需要确保Oracle服务正在运行,接下来,我认为您需要尝试ojdbc14。

it was easy ! just do not forgot to conform your database connection string.

as in figure , if u filled fields like HOST , PORT , SID then ti will change the connection string that is generated automatically,

it was my simple mistake which bother me for one week ! thanks lot for everyone who guided me and specially for @Stanley!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM