I will recommend two things to solve this problem: First, try to specify the database name in capital letters. Although db is case insensitive, sometimes it works fine with headers.
Secondly, this problem may arise due to some additional material that you might add with your factory session value. For example (I will take the code that I used and ran into this problem and got rid of it): Part of my xml looks like this:
<session-factory> <property name="hbm2ddl.auto">update</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="connection.url">jdbc:mysql://10.184.56.183:3306/******?relaxAutoCommit=true&autoReconnect=true&useUnicode=true&characterEncoding=utf8</property> <property name="connection.username">******</property> <property name="connection.password">******</property> <property name="hibernate.show_sql">true</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.current_session_context_class">thread</property> <property name="hibernate.connection.pool_size">5</property> <property name="hibernate.connection.shutdown">true</property> <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property> <property name="hibernate.cache.use_second_level_cache">false</property> <property name="hibernate.cache.use_query_cache">false</property> <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> <property name="hibernate.c3p0.min_size">2</property> <property name="hibernate.c3p0.max_size">5</property> <property name="hibernate.c3p0.timeout">108000</property> <property name="hibernate.c3p0.max_statements">50</property> <property name="hibernate.c3p0.idle_test_period">1000</property> <property name="hibernate.c3p0.validate">true</property> <property name="hibernate.c3p0.acquire_increment">5</property>
So keep trimming the extra values, for example, clear the database connection URL and more. I ran into a problem while creating code from a database table. So I created another xml configurator and made it as simple as possible, and thatβs all. Everything went perfectly.
source share