连接数据库org.postgresql postgresql
public class T0001 { public static void main(String[] args) throws SQLException, ClassNotFoundException { Class.forName("org.postgresql.Driver"); Connection connection = DriverManager.getConnection("jdbc:postgresql://xx.xx.xx.xx:port/db_name","username","password"); System.out.println(connection.isClosed()); } } // 返回 connection.isClosed() -------> false 说明连接成功Reference
jdbc获得所有数据库表
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)