MySQL + Hibernate configuration in Mac OS

来源:互联网 发布:js eval详解 编辑:程序博客网 时间:2024/05/16 10:01

1 MySQL

    1) download MySQL from somewhere, mysql-5.5.13-osx10.6-x86.dmg, I just google it when I need to download.

http://download.softagency.net/mysql/Downloads/MySQL-5.5/  This is one of the repository

    2) MySQL JDBC Connector: mysql-connector-java-5.1.16.tar download it from Sourceforge, extract, put the jar file into lib folder of your project

    3) you can try with MySQL Front-end administration tool, e.g. "Navicat Lite", create a database, a table, and put some data into it.

    4) write some test code to see if it works with this env.

 

 

2 Hibernate

    1) download hibernate libs, hibernate-release-4.0.0.Beta1, could always download it from hibernate.org

    2) copy into lib folder

    3) install hibernate eclipse plugins and features, help you create xml cfg files

    4) _____not sure, if we could use JBoss download Hibernate and auto cfg all jar files? (version conflict prb might be involved, and make it unable to find class, just google and check versions, slf4j-1.6.1 download this, and put into lib folder)

    5) little test on env.

 

    Hibernate cfg xml

     

     Mapping class //ID as a key value need to be set as auto incremental

      

     Test Code in Main

      

 

     should work then!