有人可以建议我在这里做错了什么:
获取错误消息为“ SQL 状态:08001 没有找到适合 jdbc:oracle:thin:@128:23:44:01:12345:pppp_rr 的驱动程序 Picked up JAVA_TOOL_OPTIONS: -Duser.home=C:\Users\123ert ”
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class JDBCExample {
public static void main(String[] args) {
try (Connection conn = DriverManager.getConnection(
"jdbc:oracle:thin:@128:23:44:01:12345:pppp_rr", "Test123", "********")) {
if (conn != null) {
System.out.println("Connected to the database!");
} else {
System.out.println("Failed to make connection!");
}
} catch (SQLException e) {
System.err.format("SQL State: %s\n%s", e.getSQLState(), e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Qyouu
相关分类