Hibetnate+postgresql First Experience and demo

Source: Internet
Author: User
Tags postgresql

Recently learning hibernate, the common tutorial is to go with MySQL, because the company's local computer with PG, so try to do a PG small demo. He is also learning to write, only to deepen the impression. Words do not say much, direct start;

A) Prepare the necessary documents and environment;

1) Local Installation PostgreSQL, this does not say, oneself to download online;

Note: PG 9.4 is used for this time

2) Download the JDBC Driver for PG;

Website: can fq point this download, cannot fq own Baidu bar.

To illustrate, there are 4 versions of the support pg9.4, depending on your JDK choice:

JDBC3 Postgresql Driver, Version 9.3-1103 (< jdk1.6)

JDBC4 Postgresql Driver, Version 9.4.1212 (= jdk1.6)

JDBC41 Postgresql Driver, Version 9.4.1212 (= jdk1.7)

JDBC42 Postgresql Driver, Version 9.4.1212 (= jdk1.8)

3) Download the Hibernate jar package;

Website: Fq Download (file is quite big, 248M); Since it is learning, it is directly on the latest version: 5.2.4.Final (2016-10-26)

Post-Unzip directory:

      

ii) departure;

1) PG Create a user feedback form (feedback);

Create TableFeedback (ID serial not NULL Primary Key,     //serial is equivalent to the int auto_increment in MySQL, which achieves self-growth effect usernamevarchar( $) not NULL, Contentvarchar( $) not NULL, Sendtimetimestamp  not NULL)

(... Not to be continued)

Hibetnate+postgresql First Experience and demo

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.