Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6474123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:32:58+00:00 2026-05-25T06:32:58+00:00

When I try to load an object( a row ) from mysql database, the

  • 0

When I try to load an object( a row ) from mysql database, the string properties are not loaded properly , and as a result when I print them, nothing is displayed.

here is my hibernate config file :

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM 
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
  <session-factory>    
    <property name="connection.driver_class">
       com.mysql.jdbc.Driver
    </property>
    <property name="connection.url">
      jdbc:mysql://localhost:3306/demo_hib_1
    </property>
    <property name="connection.username">root</property>
    <property name="connection.password"> </property>
    <property name="pool_size">5</property>
    <property name="show_sql">true</property>
    <property name="dialect">
      org.hibernate.dialect.MySQLDialect
    </property>
    <!-- Mapping files -->

     <mapping resource="com/navid/Person.hbm.xml"/>

  </session-factory>
</hibernate-configuration>

I tryed adding encoding to connection url :

jdbc:mysql://localhost:3306/demo_hib_1&characterEncoding=UTF-8

and got hibernate exception :

Exception in thread "main" org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2246)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:2158)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:2137)
    at com.navid.Main.main(Main.java:31)
Caused by: org.dom4j.DocumentException: Error on line 10 of document  : The reference to entity "characterEncoding" must end with the ';' delimiter. Nested exception: The reference to entity "characterEncoding" must end with the ';' delimiter.
    at org.dom4j.io.SAXReader.read(SAXReader.java:482)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2238)
    ... 3 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:32:59+00:00Added an answer on May 25, 2026 at 6:32 am

    The hibernate config file is an XML file, so raw & symbols aren’t allowed

    Two options that spring to mind (but untested!), the first would be to use the XML &amp; escape sequence:

    <property name="connection.url">
      jdbc:mysql://localhost:3306/demo_hib_1?useUnicode=true&amp;characterEncoding=UTF-8
    </property>
    

    Or using name+value syntax, which wouldn’t need the & escaping:

    <property name="connection.url" value="jdbc:mysql://localhost:3306/demo_hib_1?useUnicode=true&characterEncoding=UTF-8" />
    

    Note that I’ve added a 2nd option too, I think you need both

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to fill listbox. I generated textbox and labels from database. (My platform
I try to load about 30.000 record to mysql select. than i get this
I'm using the following HQL query to try and load a set of objects
I am using xml.net in web application When I try load xml through an
When I try to load a solution in Visual Studio 2008, it immediately closes.
I currently have issues in Webkit(Safari and Chrome) were I try to load dynamically
I try to us wp_enqueue_script to load my javascript, here is my code: <?php
when i try to do this and load the webforms page, i get this
I have an XML document that I load in and try to search with
I am assigning ViewState[something] in Page Load of content page and when I try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.