0

Infobright データベース コミュニティ バージョンは、SQL Insert ステートメントを実装していません。代わりに、データの読み込みに他のステートメントを使用します。以下のリンクを参照してください。

https://support.infobright.com/forums/showthread.php?7939-insert-in-table

したがって、hibernate は挿入ステートメントを使用するため、infobright データベースへのデータの保存では機能しません。

Hibernate: insert into Desenvolvedor (Cidade, Estado, Nome) values (?, ?, ?)
org.hibernate.exception.GenericJDBCException: could not execute statement
at org.hibernate.exception.internal.StandardSQLExcept ionConverter.convert(StandardSQLExceptionConverter .java:54)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.c onvert(SqlExceptionHelper.java:126)
...
Caused by: java.sql.SQLException: Table storage engine for 'desenvolvedor' doesn't have this option
at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:1086)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:4237)
...

以下は、hibernate.cfg.xml ファイルです。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
  <!-- Database connection properties - Driver, URL, user, password -->
  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="hibernate.connection.password">test</property>
  <property name="hibernate.connection.url">jdbc:mysql://10.61.15.117:5029/test</property>
  <property name="hibernate.connection.username">TestUser</property>
  <!-- Outputs the SQL queries, should be disabled in Production -->
  <property name="hibernate.show_sql">true</property>
  <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
  <property name="hibernate.connection.pool_size">1</property>
  <mapping class="base.Desenvolvedor"/>
</session-factory>
</hibernate-configuration>

誰かがすでにこの問題に直面していますか? Community Infobright データベースにこのデータ挿入を実装するには、Hibernate の createSQLQuery() メソッドを使用するか、JDBC を直接使用する必要がありますか?

ありがとう、

カニカリ

4

1 に答える 1

0

採用された解決策は、テーブル エンジンを BRIGHTOUSE から MYISAM に変更することでした。この最後のものは、休止状態によって生成された挿入コマンドを受け入れます。SQL Create Table ステートメントでは、データベース エンジンのデフォルトを変更せずにテーブルのエンジンを設定できます。

create table test.Desenvolvedor (
    nome varchar(11),
    cidade varchar (255),
    estado varchar (255)
) engine = MYISAM
于 2015-03-31T13:28:56.627 に答える