我已经在Netbeans中创建了一个本地Apache Derby数据库,但是在尝试使用“Hibernate逆向工程向导”自动生成POJO文件时遇到了问题。
我的Hibernate配置(由Netbeans从数据库连接生成,然后我添加了一些位):
<?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>
<!-- Default Netbeans generated parameters -->
<property name="hibernate.connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
<property name="hibernate.connection.url">jdbc:derby:C:/CerealDatabase</property>
<property name="hibernate.connection.username">cerealuser</property>
<property name="hibernate.connection.password">cerealpass</property>
<!-- Additional parameters -->
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.default_schema">CEREALUSER</property>
</session-factory>
</hibernate-configuration>
当我尝试使用这个配置文件生成pojo时,我会得到一条消息来检查我的配置文件,derby.log会给出错误:
java.sql.SQLException: Failed to start database 'C:/CerealDatabase', see the next exception for details.
Caused by: java.sql.SQLException: Failed to start database 'C:/CerealDatabase', see the next exception for details.
Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database C:\CerealDatabase.
在尝试此操作之前,我已关闭了与数据库的任何其他连接,并且当时没有“db.lck”锁定文件,这表示没有与数据库的连接(据我所知)。
有人有什么想法吗?感激地接受了帮助。