I remember that the connection of 127.0.0.1 to the db from java was successful.
By the way, I remember that when I connected to the IP address from the database of another computer connected to the network, I couldn't connect.
Is it because the pc is using the scott account in dbms?
What's the reason?
public Connection getConnection(){
try {
String url = "jdbc:oracle:thin:@127.0.0.1:1521:xe";
//url used 127.0.0.1 as a different ip address, so I remember that the connection was not possible.
String user = "SCOTT";
String password = "TIGER";
conn = DriverManager.getConnection(url, user, password);
} } catch (Exception e) { // TODO: handle exception }
return conn;
}
Would you like to check the two below?
© 2024 OneMinuteCode. All rights reserved.