我有一个使用JPA的JEE Web项目,并且应在JBoss EAP 6.1.0.GA(AS 7.2.0.Final-redhat-8)上运行。我想使用内存数据库H2测试该项目。我部署了应用程序,在控制台上看到以下内容:
13:55:18,587 INFO [stdout] (ServerService Thread Pool -- 87) Hibernate: create table seatforshow (id integer not null, isFree boolean not null, price decimal(19,2), rowNo tinyint not null, seatNo tinyint not null, filmShow_id integer not null, primary key (id))
13:55:18,588 INFO [stdout] (ServerService Thread Pool -- 87) Hibernate: alter table filmshow add constraint FKD4A76E8171BAB7DF foreign key (cinema_id) references cinema
13:55:18,591 INFO [stdout] (ServerService Thread Pool -- 87) Hibernate: alter table filmshow add constraint FKD4A76E81D7BB783F foreign key (film_id) references film
13:55:18,593 INFO [stdout] (ServerService Thread Pool -- 87) Hibernate: alter table seat add constraint FK35CE0571BAB7DF foreign key (cinema_id) references cinema
13:55:18,595 INFO [stdout] (ServerService Thread Pool -- 87) Hibernate: alter table seatforshow add constraint FK5B4E2DA141F8E4BF foreign key (filmShow_id) references filmshow
13:55:18,597 INFO [stdout] (ServerService Thread Pool -- 87) Hibernate: create sequence hibernate_sequence start with 1 increment by 1
13:55:18,598 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 87) HHH000230: Schema export complete
但是,我打开
localhost:8080 / h2-console / console /
我在那里没有看到我的桌子。我想可能需要提供架构名称(或数据库名称),但是我不确定。有人可以帮忙吗?
答案 0 :(得分:0)
问题出在上面显示的连接URL中: jdbc:h2:〜test 这与文件standalone.xml(定义了数据源)中的connectionURL不匹配。 两者都匹配后,控制台上将显示正确的数据库(和表)。