java.sql.SQLException:Io 异常:The Network Adapter could not es
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/13 19:38:40
java.sql.SQLException:Io 异常:The Network Adapter could not establish the connection
刚安装的oracle 写的DB就执行出这个错,
package db;
import java.sql.Connection;
import java.sql.DriverManager;
public class DB {
\x05Connection conn;
\x05public Connection getConn() {
\x05\x05return conn;
\x05}
\x05public DB(){
\x05\x05String driver="oracle.jdbc.driver.OracleDriver";
\x05\x05String url="jdbc:oracle:thin:@localhost:1521:orcl";
\x05\x05
\x05\x05try {
\x05\x05\x05Class.forName(driver);
\x05\x05\x05conn=DriverManager.getConnection(url,"scott","tiger");
\x05\x05\x05System.out.println(conn);
\x05\x05} catch (Exception e) {
\x05\x05\x05e.printStackTrace();
\x05\x05}
\x05}
\x05public static void main(String[] args) {
\x05\x05new DB();
\x05}
}
连不上数据库,这个该怎么解决啊难道是权限问题?
刚安装的oracle 写的DB就执行出这个错,
package db;
import java.sql.Connection;
import java.sql.DriverManager;
public class DB {
\x05Connection conn;
\x05public Connection getConn() {
\x05\x05return conn;
\x05}
\x05public DB(){
\x05\x05String driver="oracle.jdbc.driver.OracleDriver";
\x05\x05String url="jdbc:oracle:thin:@localhost:1521:orcl";
\x05\x05
\x05\x05try {
\x05\x05\x05Class.forName(driver);
\x05\x05\x05conn=DriverManager.getConnection(url,"scott","tiger");
\x05\x05\x05System.out.println(conn);
\x05\x05} catch (Exception e) {
\x05\x05\x05e.printStackTrace();
\x05\x05}
\x05}
\x05public static void main(String[] args) {
\x05\x05new DB();
\x05}
}
连不上数据库,这个该怎么解决啊难道是权限问题?
数据库连不上
再问: 在别人的电脑上就能连上,为什么换到我的电脑就不行了呢?会不会是新安装的oracle还有什么没有设置?
再答: 数据库启动了么,至少tnslistener和orcl两个服务
再问: 在别人的电脑上就能连上,为什么换到我的电脑就不行了呢?会不会是新安装的oracle还有什么没有设置?
再答: 数据库启动了么,至少tnslistener和orcl两个服务
java.sql.SQLException:Io 异常:The Network Adapter could not es
java.sql.SQLException:IO 错误:The Network Adapter could not es
求 java java.sql.SQLException:The Network Adapter could not e
JDBC连接ORACLE:The Network Adapter could not establish the con
java.sql.SQLException:Operation not allowed after ResultSet
java.sql.SQLException:The transaction is no longer active-st
java.sql.SQLException:Couldn't perform the operation prepare
java.sql.SQLException: Listener refused the connection with
java.sql.SQLException:Listener refused the connection with t
具体信息如下:java.sql.SQLException:Listener refused the connection
java 连接oracle报错java.sql.SQLException: Listener refused the c
java.sql.SQLException:ORA-00917:缺失逗号