로컬 시스템 postgresql DB에 연결하는 JDBC 프로그램이 있습니다.jdbc 유형 4 드라이버를 사용하여 다른 시스템 db에 연결하는 방법
Class.forName("org.postgresql.Driver");
Connection con=DriverManager.getConnection("jdbc:postgresql://localhost:5432/LOCATIONS_INFO","postgres","password");
System.out.println("Connection Created");
이것은 성공적으로 실행됩니다. 또한 같은 LAN에있는 다른 시스템에있는 postgresql 데이터베이스에 연결하려고합니다. 내가 연결할 localhost를 다른 시스템의 IP로 대체 할 때 예외가 발생합니다.
연결 방법을 알려주세요.
적어도 예외 + 스택 추적 게시 –