MyEclipse连接oracle

来源:百度知道 编辑:UC知道 时间:2024/06/14 07:34:26
myeclipse工程中用hibernate连接oracle时,不能查询出自建表(njm)中的内容,但数据库中的scott用户下的自带表dept确可以查询出内容来如:

Hibernate: select dept0_.DEPTNO as DEPTNO1_0_, dept0_.DNAME as DNAME1_0_, dept0_.LOC as LOC1_0_ from SCOTT.DEPT dept0_ where dept0_.DEPTNO=?
ACCOUNTING:NEW YORK(<----dept表中的内容)(下面就是我自己建立的表njm)
Hibernate: select njm0_.ID as ID0_0_, njm0_.NAME as NAME0_0_ from SCOTT.NJM njm0_ where njm0_.ID=?
Exception in thread "main" java.lang.NullPointerException
at biz.Test.main(Test.java:21)

如果是myeclipse 最好先用 DB Browser 把数据库连接上,然后在自动生成mapping文件!

是没查到,还是查不出。
还有,hibernate的mapping有没有放到sessionfactory里

就是没有记录嘛