-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Infobright Data Loading
PostPosted: Thu Mar 26, 2015 6:30 pm 
Newbie

Joined: Thu Mar 26, 2015 5:16 pm
Posts: 2
Hi!

I am new to hibernate.

Infobright does not implement the SQL Insert statement. It uses other statements for data inserting instead. See link below:

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

Therefore hibernate does not work on saving data to infobright data base since hibernate uses the insert statament.

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

Below is the hibernate.cfg.xml file:

Code:
<?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>


Has someone already face this problem? Is it necessary to use createSQLQuery to implement this data insert? Is there another better way than this?

Thanks,

Canicali


Top
 Profile  
 
 Post subject: Re: Infobright Data Loading
PostPosted: Tue Mar 31, 2015 9:30 am 
Newbie

Joined: Thu Mar 26, 2015 5:16 pm
Posts: 2
The adopted solution was changing the table engine from BRIGHTOUSE to MYISAM. This last one accepts insert commands generated by hibernate. On SQL Create Table statement it is possible to set the table's engine without changing the data base engine default.

Code:
create table test.Desenvolvedor (
    nome varchar(11),
    cidade varchar (255),
    estado varchar (255)
) engine = MYISAM


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.