简单JDBC连接实例-postgresql使用方法

时间:2021-04-25 21:27:51
【文件属性】:
文件名称:简单JDBC连接实例-postgresql使用方法
文件大小:1.37MB
文件格式:PPT
更新时间:2021-04-25 21:27:51
postgresql 简单JDBC连接实例 import java.sql.DriverManager; import java.sql.Connection; import java.sql.SQLException; public class Example1 { public static void main(String[] argv) { System.out.println(“检查注册驱动程序"); try { Class.forName("org.postgresql.Driver"); } catch (ClassNotFoundException cnfe) { System.out.println(“不能找到驱动程序!"); System.out.println(“程序退出"); cnfe.printStackTrace(); System.exit(1); }

网友评论