I am newbie to h2 database.I have created some tables in h2 using browser console. when i try to create the hibernate.cfg file it creates like below.
我是h2数据库的新手。我使用浏览器控制台在h2中创建了一些表。当我尝试创建hibernate.cfg文件时,它创建如下。
<?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">org.h2.Driver</property>
<property name="hibernate.connection.url">jdbc:h2:~/selva</property>
</session-factory>
</hibernate-configuration>
But when i try to create a reverse engineering i got the below error.
但是当我尝试创建逆向工程时,我得到了以下错误。
why it happens?.Netbeans create reverse enginnering file for mysql and mssql databse.But why not create the h2?
它为什么会发生?.Netbeans为mysql和mssql数据库创建反向工程文件。但为什么不创建h2?
Cannot establish database connection with selected Hibernate Configuration file. Please verify the database connection details in hibernate.cfg.xml.
1.How to solve the above issue?
2.Is Querying inmemory database in hibernate is different from the persistent database?
2.Is Configuring inmemory database in hibernate is different from the persistent database?
Any help will be greatly appreciated!!!
任何帮助将不胜感激!!!
2 个解决方案
#1
0
hey i was having the same issue, so i just right clicked the default package under the source package of the particular project in netbeans and then made the reverse engineering file...netbeans is then successfully creating the hibernate.reveng.xml file
嘿,我有同样的问题,所以我只是右键单击netbeans中特定项目的源包下的默认包,然后制作逆向工程文件... netbeans然后成功创建hibernate.reveng.xml文件
#2
-1
You must start MySQL service and then connect to MySQL. Then go to services tab in Netbeans. Then stop Java db. Delete any Java db connection. Then go to MySQL Server Properties
. Select basic properties and enter them. Then select
您必须启动MySQL服务然后连接到MySQL。然后转到Netbeans中的服务选项卡。然后停止Java db。删除任何Java数据库连接。然后转到MySQL服务器属性。选择基本属性并输入它们。然后选择
Admin Properties
Path/Url to admin tool: c:\program files(x86)\mysql\mysql workbench 6.3 cE\MySQLWorkbench.exe
路径/网址管理工具:c:\ program files(x86)\ mysql \ mysql workbench 6.3 cE \ MySQLWorkbench.exe
Admin tool you can use phpmyadmin
, dbeaver
, dbforgestudio
, sql yog
or any other thing.
管理工具你可以使用phpmyadmin,dbeaver,dbforgestudio,sql yog或任何其他东西。
Path to stop command:
Arguements: -uroot -proot shutdown
停止命令的路径:
争论:-uroot -proot shutdown
if root is your username and password. First never store your libraries in a dedicated folder
如果root是您的用户名和密码。首先永远不要将您的库存储在专用文件夹中
- Click
File > New Project
- Select
Java Web Application
- Select project name, uncheck use dedicated folder for storing libraries
- Select Apache Tomcat then under frameworks select Hibernate 4.3.1
- Select New Database Connection
- Select driver Mysql(connector/J driver) then test connection if okay click Finish
单击文件>新建项目
选择Java Web Application
选择项目名称,取消选中使用专用文件夹存储库
选择Apache Tomcat然后在框架下选择Hibernate 4.3.1
选择新数据库连接
选择驱动程序Mysql(connector / J driver)然后测试连接,如果没问题,单击Finish
Then you must be able to do database operations from Netbeans.
然后,您必须能够从Netbeans进行数据库操作。
- Click the project select New > Other > Hibernate > Hibernate Reverse Engineering Wizard > then name > then hibernate.cfg.xml > finish
- Then you must see hibernate connection properties in the cdg file.
单击项目选择New> Other> Hibernate> Hibernate Reverse Engineering Wizard>然后命名>然后hibernate.cfg.xml>完成
然后,您必须在cdg文件中看到hibernate连接属性。
When Netbeans makes connection to db it will takes some time or some blinking, then you are making the correct move.
当Netbeans连接到db时,它需要一些时间或一些闪烁,然后你正在进行正确的移动。
#1
0
hey i was having the same issue, so i just right clicked the default package under the source package of the particular project in netbeans and then made the reverse engineering file...netbeans is then successfully creating the hibernate.reveng.xml file
嘿,我有同样的问题,所以我只是右键单击netbeans中特定项目的源包下的默认包,然后制作逆向工程文件... netbeans然后成功创建hibernate.reveng.xml文件
#2
-1
You must start MySQL service and then connect to MySQL. Then go to services tab in Netbeans. Then stop Java db. Delete any Java db connection. Then go to MySQL Server Properties
. Select basic properties and enter them. Then select
您必须启动MySQL服务然后连接到MySQL。然后转到Netbeans中的服务选项卡。然后停止Java db。删除任何Java数据库连接。然后转到MySQL服务器属性。选择基本属性并输入它们。然后选择
Admin Properties
Path/Url to admin tool: c:\program files(x86)\mysql\mysql workbench 6.3 cE\MySQLWorkbench.exe
路径/网址管理工具:c:\ program files(x86)\ mysql \ mysql workbench 6.3 cE \ MySQLWorkbench.exe
Admin tool you can use phpmyadmin
, dbeaver
, dbforgestudio
, sql yog
or any other thing.
管理工具你可以使用phpmyadmin,dbeaver,dbforgestudio,sql yog或任何其他东西。
Path to stop command:
Arguements: -uroot -proot shutdown
停止命令的路径:
争论:-uroot -proot shutdown
if root is your username and password. First never store your libraries in a dedicated folder
如果root是您的用户名和密码。首先永远不要将您的库存储在专用文件夹中
- Click
File > New Project
- Select
Java Web Application
- Select project name, uncheck use dedicated folder for storing libraries
- Select Apache Tomcat then under frameworks select Hibernate 4.3.1
- Select New Database Connection
- Select driver Mysql(connector/J driver) then test connection if okay click Finish
单击文件>新建项目
选择Java Web Application
选择项目名称,取消选中使用专用文件夹存储库
选择Apache Tomcat然后在框架下选择Hibernate 4.3.1
选择新数据库连接
选择驱动程序Mysql(connector / J driver)然后测试连接,如果没问题,单击Finish
Then you must be able to do database operations from Netbeans.
然后,您必须能够从Netbeans进行数据库操作。
- Click the project select New > Other > Hibernate > Hibernate Reverse Engineering Wizard > then name > then hibernate.cfg.xml > finish
- Then you must see hibernate connection properties in the cdg file.
单击项目选择New> Other> Hibernate> Hibernate Reverse Engineering Wizard>然后命名>然后hibernate.cfg.xml>完成
然后,您必须在cdg文件中看到hibernate连接属性。
When Netbeans makes connection to db it will takes some time or some blinking, then you are making the correct move.
当Netbeans连接到db时,它需要一些时间或一些闪烁,然后你正在进行正确的移动。