RSS
热门关键字:  数据挖掘  数据仓库  人工智能  搜索引擎  数据挖掘导论

J2EE Search的增删查改及检索初步实现

来源: 作者: 时间:2008-06-25 点击:

准备数据库:数据库采用mysql,表(book),为演示方便,字段只有2个(id,name)

准 备 包:Hibernate 3.2 Core Libraries

                    Hibernate 3.2 Annotations

                    Hibernate 3.2 Entity Manager

                  Hibernate 3.2 Search

                   Spring 2.0 AOP Libraries

                  Spring 2.0 Core Libraries

                 Spring 2.0 Persistence Core Libraries

persistence.xml

数据挖掘研究院



<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
    http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
   
<persistence-unit name="jpaspringPU"
   transaction-type="RESOURCE_LOCAL">
   <provider>org.hibernate.ejb.HibernatePersistence</provider>
   <class>com.jpa.Book</class> --此类和数据库book表映射
   <properties>
    <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
    <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test" /> 数据挖掘实验室
    <property name="hibernate.connection.username" value="root" />
    <property name="hibernate.connection.password" value="root" />
    <property name="hibernate.show_sql" value="true"/>
最新评论共有 1 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
匿名?