Jbuilderx+sql Server Development Hibernate

Source: Internet
Author: User

Environment:

Development of the Ide:jbuilderx

Database used: MS SQL Server 2000

Database driver used: Jsql Driver (JDBC 3.0)

Description

1. Hibernate explicitly "Microsoft Driver (not recommended!)" In the configuration file, so use Jsql Driver first.

2, Jsql driver can get to the http://www.jnetdirect.com, need to register a user before downloading to the trial version.

3, JDBC3.0 can only be used in JDK1.4 and above version, Jbuilderx the default is JDK1.4

Preparatory work:

1, download hibernate, the current highest version is 2.1.2

2, in the JBuilder to create a lib, named Hibernate_full, will hibernatelib all the jars under all put in, and will Hibernatehibernate2.jar also put in

3, in the JBuilder to create a lib, named JSQL3, will jsql driver under the Jnetdirectjsqlconnectjdbc_3.0_driverjsqlconnect.jar put in

Start with examples:

1, create a project, named Testhibernate

2. Add Hibernate_full and JSQL3 to the required libraries in the attribute

3. Select the XML file in the menu Project--> Project Properties--> build--> Resource, select "Copy"--When compiling the project, Automatically copies the XML files in the SRC folder to the corresponding directories in the Classes folder

4. Create a src directory in the Testhibernate project

5, the Hibernate source files in the hibernatesrchibernate.properties and log4j.properties copy to the Testhibernate project in the SRC directory

6, modify the configuration of MS SQL Server 2000 driver in Hibernate.properties

Found it

## HypersonicSQL
hibernate.dialect net.sf.hibernate.dialect.HSQLDialect
hibernate.connection.driver_class org.hsqldb.jdbcDriver
hibernate.connection.username sa
hibernate.connection.password
hibernate.connection.url jdbc:hsqldb:hsql://localhost
hibernate.connection.url jdbc:hsqldb:test
hibernate.connection.url jdbc:hsqldb:.

This paragraph, here is the default is to use Hypersonicsql, we are using MS SQL Server, so the whole comment out

## HypersonicSQL
#hibernate.dialect net.sf.hibernate.dialect.HSQLDialect
#hibernate.connection.driver_class org.hsqldb.jdbcDriver
#hibernate.connection.username sa
#hibernate.connection.password
#hibernate.connection.url jdbc:hsqldb:hsql://localhost
#hibernate.connection.url jdbc:hsqldb:test
#hibernate.connection.url jdbc:hsqldb:.

Also, find

## MS SQL Server
#hibernate.dialect net.sf.hibernate.dialect.SQLServerDialect
#hibernate.connection.username sa
#hibernate.connection.password sa
## JSQL Driver
#hibernate.connection.driver_class com.jnetdirect.jsql.JSQLDriver
#hibernate.connection.url jdbc:JSQLConnect://1E1/test

This paragraph, for example we use the database server machine name is Yuj, the database name is Testhi, connects to the database the user name is SA, the password is SA, then after the modification this paragraph becomes

## MS SQL Server
hibernate.dialect net.sf.hibernate.dialect.SQLServerDialect
hibernate.connection.username sa
hibernate.connection.password sa
## JSQL Driver
hibernate.connection.driver_class com.jnetdirect.jsql.JSQLDriver
hibernate.connection.url jdbc:JSQLConnect://yuj/testhi

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.