为了账号安全,请及时绑定邮箱和手机立即绑定

执行SQL语句时报错

执行SQL语句时报错

豫州 2017-04-01 20:03:11
下面是报错:四月 01, 2017 7:54:52 下午 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {5.2.9.Final}四月 01, 2017 7:54:52 下午 org.hibernate.cfg.Environment <clinit>INFO: HHH000206: hibernate.properties not found四月 01, 2017 7:54:52 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}四月 01, 2017 7:54:52 下午 org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntityWARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-mapping. Use namespace http://www.hibernate.org/dtd/hibernate-mapping instead.  Support for obsolete DTD/XSD namespaces may be removed at any time.四月 01, 2017 7:54:52 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureWARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)四月 01, 2017 7:54:52 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreatorINFO: HHH10001005: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:///hibernate?useUnicode=true&characterEncoding=UTF-8&useSSL=false]四月 01, 2017 7:54:52 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreatorINFO: HHH10001001: Connection properties: {user=root, password=****}四月 01, 2017 7:54:52 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreatorINFO: HHH10001003: Autocommit mode: false四月 01, 2017 7:54:52 下午 org.hibernate.engine.jdbc.connections.internal.PooledConnections <init>INFO: HHH000115: Hibernate connection pool size: 20 (min=1)四月 01, 2017 7:54:53 下午 org.hibernate.dialect.Dialect <init>INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialectHibernate:         drop table if exists STUDENTS四月 01, 2017 7:54:53 下午 org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnectionINFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@285d851a] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.Hibernate:         create table STUDENTS (       SID integer not null,        SNAME varchar(255),        GENDER varchar(255),        BIRTHDAY datetime,        ADDRESS varchar(255),        primary key (SID)    ) type=MyISAM四月 01, 2017 7:54:53 下午 org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnectionINFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@f9b7332] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.四月 01, 2017 7:54:53 下午 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL via JDBC Statement    at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67)    at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:440)    at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:424)    at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:315)    at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:166)    at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:135)    at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:121)    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:155)    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:309)    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:445)    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:710)    at StudentsTest.init(StudentsTest.java:29)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)    at java.lang.reflect.Method.invoke(Unknown Source)    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=MyISAM' at line 8    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)    at java.lang.reflect.Constructor.newInstance(Unknown Source)    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)    at com.mysql.jdbc.Util.getInstance(Util.java:408)    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2497)    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2455)    at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)    at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)    at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54)    ... 36 more四月 01, 2017 7:54:53 下午 org.hibernate.tool.schema.internal.SchemaCreatorImpl applyImportSourcesINFO: HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@6b5176f2'Hibernate:     insert     into        STUDENTS        (SNAME, GENDER, BIRTHDAY, ADDRESS, SID)     values        (?, ?, ?, ?, ?)四月 01, 2017 7:54:53 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsWARN: SQL Error: 1146, SQLState: 42S02四月 01, 2017 7:54:53 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsERROR: Table 'hibernate.students' doesn't exist四月 01, 2017 7:54:53 下午 org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl releaseINFO: HHH000010: On release of batch it still contained JDBC statements四月 01, 2017 7:54:53 下午 org.hibernate.internal.ExceptionMapperStandardImpl mapManagedFlushFailureERROR: HHH000346: Error during managed flush [org.hibernate.exception.SQLGrammarException: could not execute statement
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 7213 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信