数据库

 首页 > 数据库 > postgresql > jdbc 连接 Postgresql 8.4数据库的方法

jdbc 连接 Postgresql 8.4数据库的方法

分享到:
【字体:
导读:
         摘要:以前用JAVA在做数据库连接的时候还没试过用Postgresql由于JDBC简便性,使得连接各种数据库也方便,只需设置几个参数。用JDBC操作要先下载驱动包TodetermineJDK/JVMcompatibilitythisfollowinglistmatchesupversionsoftheJVMwiththeJD...

jdbc 连接 Postgresql 8.4数据库的方法

以前用JAVA在做数据库连接的时候还没试过用Postgresql  由于JDBC简便性,使得连接各种数据库也方便,只需设置几个参数。

用JDBC操作要先下载驱动包

To determine JDK/JVM compatibility this following list matches up versions of the JVM with the JDBC specification implemented.

JDK 1.1 - JDBC 1. Note that with the 8.0 release JDBC 1 support has been removed, so look to update your JDK when you update your server.

JDK 1.2, 1.3 - JDBC 2.

JDK 1.3 + J2EE - JDBC 2 EE. This contains additional support for javax.sql classes.

JDK 1.4, 1.5 - JDBC 3. This contains support for SSL and javax.sql, but does not require J2EE as it has been added to the J2SE release.

JDK 1.6 - JDBC4. Support for JDBC4 methods is limited. The driver builds, but the majority of new methods are stubbed out.

如果项目采用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支持各种平台

PostgreSQL Core Distribution

The core of the PostgreSQL object-relational database management system is available in several source and binary formats. The full package includes:

The core server with full documentation (html, man)

Several command line tools (e.g. psql, pg_ctl, pg_dump, pg_restore)

C library (libpq) and embedded C processor (ecpg)

Several server-side procedural languages (e.g. plpgsql, pltcl, plperl)

Several popular add-on packages (e.g. metaphone, pgcrypto and other useful enhancements)

In addition, some 'one click' installers include additional packages such as pgAdmin and PostGIS.

Binary packages

Pre-built binary packages are available for a number of different operating systems:

jdbc 连接 Postgresql 8.4数据库的方法
分享到:
PostgreSQL和MySQL数据库的备份方法
PostgreSQL和MySQL数据库的备份方法   无论是MySQL还是PostgreSQL数据库,如果你不能每天对其进行备份的话,那么应该每周对这些数据库进行备份操作一次。对许多企业来说,数据库信息代表着网站内容和其它重要的数据,因此,保持数据备份是非常重要的操作。   庆幸的是,MySQL和PostgreSQL都提供将数据库转化成flat-...
如何将MySQL数据库转移至PostgreSQL
如何将MySQL数据库转移至PostgreSQL 在北美,人们对于 PostgreSQL 的热情不断升温。随着 PostgreSQL 的发展, PostgreSQL 8.x 已经从技术上超越 MySQL 5.x ,而市场的超越相信只是时间问题。而最终,用户也许有机会享受到可媲美 Oracle 的开源数据库也未尝没有可能。 我供职的互联网公司,服务约 50 万商务用户...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……