If you are using Oracle's MySQL as database in your Hibernate project then you must use mysql-connector-java-5.x.xx-bin.jar JDBC jar. The <property name="connection.url"> tag in hibernate.cfg.xml must have the value jdbc:mysql://localhost:3306/myDb where myDb is your database name.
Code snippet for Hibernate's Database connection settings in hibernate.cfg.xml,
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/myDb</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
If you are not working on the localhost then it must be the IP address of the server where the MySQL database is located.
More Posts related to Java,
- [Fix] java.time.zone.ZoneRulesException: Unknown time-zone ID
- Parse XML file in Java using DOM Parser
- Java equals method - Tutorial
- [Program] How to read three different values using Scanner in Java
- Java: The value of the local variable string is not used
- Display Output in Java Console as a Table
- How to detect Operating System using Java code
- Java 8 Streams map() with examples
- [Fix] java: incompatible types: incompatible parameter types in lambda expression error
- Add newline character Java code example (\r \n \r\n)
- List of Java Major Minor Version Numbers
- IntelliJ Keyboard Shortcut to remove unused imports [Java]
- Java - Check if array contains the value
- [Fix] Java Exception with Lambda - Cannot invoke because object is null
- How to declare and initialize Array in Java Programming
- [Solved] com.sun.xml.ws.transport.http.servlet.WSServletContextListener ClassNotFoundException
- XmlRpcException ConnectException connection refused error
- Create a Zip file using Java Code programmatically
- List of jar files for Jax-ws (SOAP) based Java Web Services
- How to fix Java HTTP java.net.UnknownHostException
- List of jars required for Struts2 project
- [fix] java: incompatible types: double cannot be converted to java.lang.Integer Generics
- Maven BUILD FAILURE: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
- Get the current timestamp in Java
- java: unclosed string literal [Error]
More Posts:
- Android Activity Main xml stuck loading - Android-Studio
- How to create StackOverflow error in java - Java
- How to fix: You will need Google Chrome to install most apps, extensions and themes. - Chrome
- Sublime Text 3 Convert Case to Upper, Lower, Title or Swap - Sublime-Text
- Java -Day of the week using Java 8 DayOfWeek Enum - Java
- SharePoint list excel import error - Title is a required filed and can't be empty - SharePoint
- How to send SMS on Android Emulator - Android
- Users experience call quality issue, voice distortion, disconnection with Microsoft Teams call and meeting - Teams