-->
Skip to main content

Posts

Solution : Table 'hibernate_sequence' doesn't exist

Table 'hibernate_sequence' doesn't exist  Maven + Eclipse + Hibernate 5 + Java 14 + Mysql and After successful project creation when application starts then hits the following error message  Table 'hibernate_sequence' doesn't exist. Tested with: 1, Hibernate 5.4.26 2. mysql-connector-java-8.0.22.jar 3. Java 14 4. Maven 3.6.3 Caused by: java.sql.SQLSyntaxErrorException: Table 'hibernate.hibernate_sequence' doesn't exist at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003) at org.hibernate.id.enhanced.TableStructure.executeQuery(TableStructure.java:216) at o...

How to Reverse a String in Java [2021]

How to Reverse a String in Java [2021] This tutorial will show how to reverse a string in java using 7 different ways. how to reverse a string in java is a very common question that is being asked in interviews and also with different methods as there is no inbuilt method in the String class for string reversal. Few facts about String class 1. String class is immutable thus any change in string instance creates a new string object. 2. StringBuffer/StringBuilder class has an inbuilt reverse() method. 3. As StringBuffer is synchronized so StringBuilder is preferred over StringBuffer. So let's get started...  Here are the 7 different ways to reverse a string in java Reverse a string in java using for loop. Reverse a string in java using recursion. Using the built-in string reverse function in java of StringBuilder class/StringBuffer class. Converting String to Character Array and then swapping with iteration. Reverse string using the charAt method. Reverse a string in java 8. Re...

Difference between double and float in java [2021]

Difference between double and float in java [2021] Both double  and float  are used to represent floating-point numbers in java, although there are similarities as well as differences between double and float in java. double can provide precision up to 15 to 16 decimal points whereas float provides precision up to 6 to 7 decimal places. double is more expensive in case of storage requirements . It requires 8 bytes to store a variable whereas float takes 4 bytes to store a variable. If memory is a constraint then it's better to use float than double. Here is one of the best book to learn Java: Core Java Volume 1 - Fundamentals by Cay S. Horstmann to learn more about similarities and differences between a float and a double data type in Java.  Let's discuss the differences in detail. Difference between double and float in Java 1. Suffix By default, float numbers are double in java. In order to store them in the float variable, you need to explicitly add the s...