以前用JAVA在做数据库连接的时候还没试过用Postgresql 由于JDBC简便性,使得连接各种数据库也方便,只需设置几个参数。
用JDBC操作要先下载驱动包
To determine JDK/JVM compatibility this following list matches up versions of the JVM with the JDBC specification implemented.
如果项目采用JDK1.5 那就要下载JDBC3的驱动
下载地址如下
http://jdbc.postgresql.org/download.html
JDBC连接参数如下
String dbDriver = "org.postgresql.Driver";
String url = "jdbc:postgresql://localhost:5432/dxcom";
String userName="postgres";
String password="123456";
我下的版本是 Postgresql版本 8.4 postgresql-8.4.0-1-windows.exe
下载地址:http://www.postgresql.org/download/
我们从官方可以看到 Postgresql支持各种平台
The core of the PostgreSQL object-relational database management system is available in several source and binary formats. The full package includes:
In addition, some 'one click' installers include additional packages such as pgAdmin and PostGIS.
Pre-built binary packages are available for a number of different operating systems:
本文由 Linux视野 作者:fantlam 发表,转载请注明来源!