Skip to content

Instantly share code, notes, and snippets.

@yusufcakmak
Last active January 26, 2024 07:43
Show Gist options
  • Star 30 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
  • Save yusufcakmak/aefef12a7fe4518043ec to your computer and use it in GitHub Desktop.
Save yusufcakmak/aefef12a7fe4518043ec to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/Book</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.pool_size">1</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping resource="book.hbm.xml" />
</session-factory>
</hibernate-configuration>
@GabSC
Copy link

GabSC commented Apr 27, 2018

Thank you!! :D

@Chandrakanth339
Copy link

HI . Thank you for the configuration file. Small addition..
In case if we are using @entity annotation style of mapping + xml style of hibernate configuration, then, we can include the resource of that class as <mapping class="<FULLY_QUALIFIED_CLASSNAME_ANNOTATED_WITH_ENTITY>" instead of <mapping resource="<CONFIG_FILE_NAME_IN_src/main/resources>"

Thank You

@sk1ter
Copy link

sk1ter commented Jan 1, 2019

Thanks!!

@FromSi
Copy link

FromSi commented Mar 24, 2019

Thanks!

@deenjohn
Copy link

THANKS

@swissiKarim
Copy link

Thanks!

@yahyafati
Copy link

Thanks

@bykl61
Copy link

bykl61 commented Nov 29, 2020

teşekkür ederim:)

@ShridharMP
Copy link

why always hibernae.cfg,xml file will be for Mysql DB, is there any internal relationship between particular DB.

@metogpc
Copy link

metogpc commented Apr 7, 2021

teşekkürler

@sarath123gorli
Copy link

jdbc:mysql://localhost:3306/Book

above Book name where we get? why we give Book there

@Mechatron00
Copy link

👍👍👍Thanks

@ugurhdml
Copy link

thanks

@ElronAlp
Copy link

ElronAlp commented Dec 5, 2022

thanks

@thundergokhan
Copy link

Thank you!!!

@hanmantholgir
Copy link

thanks

@Y-S-A-byte
Copy link

Thanks!

@Tulat2002
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment