로컬(솔라리스)에서 커멘드상에서는 접속이 잘 돼구여... >>psql anypass
리모트상에서 jdbc로 접속하려 하는데 에러가 발생하네여... ㅠ.ㅜ
소스 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
import java.sql.*;
public class psql {
public static void main(String args[]) {
Connection con = null;
Statement stmt = null;
System.out.println("*************************** debug ***************************");
try {
Class.forName("org.postgresql.Driver");
System.out.println("driver load OK~!");
} catch(Exception ex) {
System.out.println("driver load Exception");
System.out.println(ex.getMessage());
}
System.out.println("*************************** debug ***************************");
try {
con = DriverManager.getConnection("jdbc:postgresql://***.***.***.***:5432/anypass", "id", "passwd");
System.out.println("connection OK~!");
} catch(SQLException ex) {
System.out.println("SQL Exception");
System.out.println(ex.getMessage());
} catch(Exception ex) {
System.out.println("connection Exception");
System.out.println(ex.getMessage());
}
System.out.println("*************************** debug ***************************");
}
}
에러:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*************************** debug ***************************
driver load OK~!
*************************** debug ***************************
SQL Exception
Something unusual has occured to cause the driver to fail. Please report this exception: Exception:
java.sql.SQLException: FATAL 1: No pg_hba.conf entry for host 172.21.106.30, user postgres, databas
e anypass
Stack Trace:
java.sql.SQLException: FATAL 1: No pg_hba.conf entry for host 172.21.106.30, user postgres, databas
e anypass
at org.postgresql.Connection.openConnection(Connection.java:178)
at org.postgresql.Driver.connect(Driver.java:149)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at psql.main(psql.java:17)
End of Stack Trace
*************************** debug ***************************
pg_hba.conf :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
local all trust
host all 127.0.0.1 255.255.255.255 trust
이상입니다...
머가 잘못된건지 통 모르겠네여.. ㅠ.ㅜ 부탁드려여...
|