是在Hibernate环境中的JUnit里出现的java.sql.SQLException: 不支持的特性
java.sql.SQLException:不支持的特性atoracle.jdbc.dbaccess.DBError.throwSqlException(DBError....
java.sql.SQLException: 不支持的特性
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
at oracle.jdbc.OracleDatabaseMetaData.supportsGetGeneratedKeys(OracleDatabaseMetaData.java:4180)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:123)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.Hibernate.TeacherTest.beforClass(TeacherTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
最后结果出来了
但在执行JUnit时报的java.sql.SQLException: 不支持的特性
15:21:34,018 INFO SchemaUpdate:155 - Running hbm2ddl schema update
15:21:34,018 INFO SchemaUpdate:167 - fetching database metadata
15:21:34,023 INFO SchemaUpdate:179 - updating schema
15:21:34,162 INFO TableMetadata:65 - table found: ZL.TEACHER
15:21:34,162 INFO TableMetadata:66 - columns: [id, title, name, birthdate, gread]
15:21:34,162 INFO TableMetadata:68 - foreign keys: []
15:21:34,163 INFO TableMetadata:69 - indexes: [sys_c005217]
15:21:34,227 INFO TableMetadata:65 - table found: ZL.TECHER_ID
15:21:34,228 INFO TableMetadata:66 - columns: [value, key]
15:21:34,228 INFO TableMetadata:68 - foreign keys: []
15:21:34,228 INFO TableMetadata:69 - indexes: []
15:21:34,229 INFO SchemaUpdate:217 - schema update complete
Hibernate:
insert
into
Teacher
(birthDate, gread, name, title, id)
values
(?, ?, ?, ?, ?)
id:5 展开
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
at oracle.jdbc.OracleDatabaseMetaData.supportsGetGeneratedKeys(OracleDatabaseMetaData.java:4180)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:123)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at com.Hibernate.TeacherTest.beforClass(TeacherTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
最后结果出来了
但在执行JUnit时报的java.sql.SQLException: 不支持的特性
15:21:34,018 INFO SchemaUpdate:155 - Running hbm2ddl schema update
15:21:34,018 INFO SchemaUpdate:167 - fetching database metadata
15:21:34,023 INFO SchemaUpdate:179 - updating schema
15:21:34,162 INFO TableMetadata:65 - table found: ZL.TEACHER
15:21:34,162 INFO TableMetadata:66 - columns: [id, title, name, birthdate, gread]
15:21:34,162 INFO TableMetadata:68 - foreign keys: []
15:21:34,163 INFO TableMetadata:69 - indexes: [sys_c005217]
15:21:34,227 INFO TableMetadata:65 - table found: ZL.TECHER_ID
15:21:34,228 INFO TableMetadata:66 - columns: [value, key]
15:21:34,228 INFO TableMetadata:68 - foreign keys: []
15:21:34,228 INFO TableMetadata:69 - indexes: []
15:21:34,229 INFO SchemaUpdate:217 - schema update complete
Hibernate:
insert
into
Teacher
(birthDate, gread, name, title, id)
values
(?, ?, ?, ?, ?)
id:5 展开
4个回答
展开全部
TeacherTest是你写的代码吧,异常堆栈列表中,下面的信息
com.Hibernate.TeacherTest.beforClass(TeacherTest.java:22)
说明在这个类的程序的22行,即beforClass方法中,提交给数据库的sql语句有问题,你可以把这个语句周围的代码贴出来看看。
抛出的是SQLException,说明已经把请求提交给数据库了,数据库在执行sql语句是发生了错误,这样的错误才会被java包装成 SQLException,所以不应该是配置文件之列的问题,应该检查程序中的sql语句。
com.Hibernate.TeacherTest.beforClass(TeacherTest.java:22)
说明在这个类的程序的22行,即beforClass方法中,提交给数据库的sql语句有问题,你可以把这个语句周围的代码贴出来看看。
抛出的是SQLException,说明已经把请求提交给数据库了,数据库在执行sql语句是发生了错误,这样的错误才会被java包装成 SQLException,所以不应该是配置文件之列的问题,应该检查程序中的sql语句。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
检查下数据源配置和方言配置,可能是这方面的原因。只贴异常栈无法确定到底哪地方有问题。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
应该是数据库配置有问题,查看配置文件吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-05-12
展开全部
啊,这么多的英文吓死我了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询