[英]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. 我试图通过从数据库节点创建新连接来对netbeans执行连接测试。
i am trying to connect with ojdbc6.jar
driver and my sid
of databse is orcl
(oracle personal edition). 我正在尝试连接ojdbc6.jar
驱动程序,而我的数据库的sid
是orcl
(Oracle个人版)。
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 在创建新连接时,我确实找到了Oracle瘦驱动程序,使用了端口1521
,我使用的是以前解锁的hr
用户,我的连接的连接字符串为jdbc:oracle:thin:@localhost:1521:orcl
但是当我执行时测试它引发消息
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), 无法使用oracle.jdbc.OracleDriver建立与jdbc:oracle:thin:@localhost:1521:orcl的连接(IO错误:网络适配器无法建立连接),
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, 如图所示,如果您填充了HOST,PORT,SID之类的字段,那么ti将更改自动生成的连接字符串,
it was my simple mistake which bother me for one week ! 这是我一个简单的错误,困扰了我一个星期! thanks lot for everyone who guided me and specially for @Stanley! 非常感谢所有引导我的人,特别是@Stanley!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.