2014-09-05 2 views
0

Java EE에서 동적 웹 프로젝트가 있습니다. "자동 데이터베이스 생성"을 Hibernate와 함께 사용할 때, 컴파일은 경고 만하는 예외를주지 않으며 데이터베이스는 생성되지 않습니다. IIS 서버가 80에 이미 있기 때문에최대 절전 모드와 포트 81의 wampserver

효과, 나는 내 hibernate.cfg.xml에서 81로 "wampserver의"포트 80을 변경, 나는이 넣어 가지고 :

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE hibernate-configuration PUBLIC 
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> 
<hibernate-configuration> 
<session-factory> 
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> 
    <property name="hibernate.connection.url">jdbc:mysql://localhost:81/DB_TRANSPORT_CARGAISON</property> 
    <property name="hibernate.connection.username">root</property> 
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> 
    <!-- Enable Hibernate's automatic session context management --> 
    <property name="current_session_context_class">thread</property> 

    <!-- JDBC connection pool (use the built-in) --> 
    <property name="connection.pool_size">1</property> 

    <!-- Disable the second-level cache --> 
    <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> 

    <!-- Echo all executed SQL to stdout --> 
    <property name="show_sql">false</property> 

    <!-- Drop and re-create the database schema on startup --> 
    <property name="hbm2dll.auto">create</property> 

    <mapping resource="dao/Cargaison.hbm.xml"/> 
    <mapping resource="dao/Marchandise.hbm.xml"/> 
</session-factory> 
</hibernate-configuration> 

하지 않는 이유는이 작품?

답변

0

81로 설정 한 포트 80은 wamp (즉, Apache 포트, ,, wamp)의 웹 서버 포트입니다. JDBC URL에서 지정해야하는 것은 MySQL 데이터베이스 서버의 포트입니다. m in wamp.

jdbc:mysql://localhost/DB_TRANSPORT_CARGAISON 
:

내 생각 엔 당신이 그렇게 잘 작동합니다 어떤 포트를 지정하지 않는, 기본 값을 할 것입니다

관련 문제