今日、私は Hibernate を発見しています。最小限のプログラムで "hibernate.cfg.xml" 構成ファイルを見つけようとして苦労しています。
これが私がすでに試したことです:
私のメイン:
package testHibernate;
import org.hibernate.cfg.Configuration;
public class Main
{
public static void main(String[] args)
{
Configuration configuration = new Configuration().configure();
}
}
このメイン ファイルの同じレベルで:
hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/pianissimo</property>
<property name="hibernate.connection.username">admin</property>
<property name="hibernate.connection.password">nx5fDdVdEGVDS6Tq</property>
</session-factory>
</hibernate-configuration>
どんな助けでも大歓迎です:) 心から、アラン