Note that there are some explanatory texts on larger screens.

plurals
  1. POhibernate mysql problems
    text
    copied!<p>there are 2 things i wish to do mysql database from hibernate.cfg.xml;</p> <ol> <li><p>To have utf8 characters so it can save character č,ć,ž,đ,š and repoduse them as thay are, not as ? in tapestry application.</p></li> <li><p>fix for the com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException</p></li> </ol> <blockquote> <p>No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error: ** BEGIN NESTED EXCEPTION ** com.mysql.jdbc.exceptions.jdbc4.CommunicationsException MESSAGE: The last packet successfully received from the server was48709 milliseconds ago.The last packet sent successfully to the server was 48709 milliseconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.</p> </blockquote> <p>my hibermate.cfg.xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt; &lt;hibernate-configuration&gt; &lt;session-factory&gt; &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt; &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt; &lt;property name="connection.url"&gt;jdbc:mysql://localhost/200&lt;/property&gt; &lt;property name="connection.username"&gt;root&lt;/property&gt; &lt;property name="connection.password"&gt;123&lt;/property&gt; &lt;property name="connection.autoReconnectForPools"&gt;true&lt;/property&gt; &lt;property name="connection.autoReconnect"&gt;true&lt;/property&gt; &lt;property name="hibernate.connection.useUnicode"&gt;true&lt;/property&gt; &lt;property name="hibernate.connection.characterEncoding"&gt;UTF-8&lt;/property&gt; &lt;property name="hibernate.connection.charSet"&gt;UTF-8&lt;/property&gt; &lt;property name="connection.pool_size"&gt;5&lt;/property&gt; &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt; &lt;!-- Print SQL to stdout. --&gt; &lt;property name="show_sql"&gt;true&lt;/property&gt; &lt;property name="format_sql"&gt;true&lt;/property&gt; &lt;property name="use_sql_comments"&gt;true&lt;/property&gt; &lt;property name="generate_statistics"&gt;true&lt;/property&gt; &lt;property name="hibernate.transaction.flush_before_completion"&gt;false&lt;/property&gt; &lt;!-- Mapping files --&gt; &lt;mapping class="domaci.entities.Korisnik"/&gt; &lt;mapping class="domaci.entities.Magazin"/&gt; &lt;mapping class="domaci.entities.Rubrika"/&gt; &lt;mapping class="domaci.entities.Strana"/&gt; &lt;/session-factory&gt; &lt;/hibernate-configuration&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload