Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

 

and many more ....

 

Receive Java & Developer job alerts in your Area

I have read and agree to the terms & conditions

 

Handle SQL Exceptions example

Bipartite Graph

This is an example of how to handle SQL Exceptions in Java. Handling SQL Exceptions implies that you should: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the Oracle JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String user, String password) API method of the DriverManager ...

Read More »

Handle SQL warning example

Bipartite Graph

In this example we shall show you how to handle SQL Warnings in Java. To handle SQL Warnings one should perform the following steps: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the Oracle JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String user, String password) ...

Read More »

Check if a database supports transactions

Bipartite Graph

With this example we are going to demonstrate how to check if a database supports transactions. In short, to check if a database supports transactions you should: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the Oracle JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String ...

Read More »

Commit/Rollback transaction example

Bipartite Graph

This is an example of a commit and a rollback transaction in Java. Handling commit and rollback transactions in Java implies that you should: Load the JDBC driver, using the forName(String className) API method of the Class. In this example we use the Oracle JDBC driver. Create a Connection to the database. Invoke the getConnection(String url, String user, String password) ...

Read More »

Connect to Oracle database example

Bipartite Graph

In this example we shall show you how to connect to Oracle Database. To connect to Oracle Database one should perform the following steps: Load the oracle.jdbc.driver.OracleDriver, using the forName(String className) API method of the Class, in order to connect to Oracle Database. Create a Connection to the database. Invoke the getConnection(String url, String user, String password) API method of ...

Read More »

Connect to SQLServer database example

Bipartite Graph

With this example we are going to demonstrate how to connect to SQLServer Database in Java. In short, to connect to SQLServer Database you should: Load the NetDirect JDBC driver, using the forName(String className) API method of the Class, in order to connect to SQLServer Database. Create a Connection to the database. Invoke the getConnection(String url, String user, String password) ...

Read More »

Connect to MySQL database example

Bipartite Graph

This is an example of how to connect to MySQL database. Connecting to the MySQL database implies that you should: Create an account, by connecting to the MySQL database on your platform as root, and then by running the command to grant privileges to your account. Load the MySQL JDBC driver, using the forName(String className) API method of the Class, ...

Read More »

Format number with custom NumberFormat

Bipartite Graph

In this example we shall show you how to format a number with a custom NumberFormat. NumberFormat provides the interface for formatting and parsing numbers. It also provides methods for determining which locales have number formats, and what their names are. To format a number with custom NumberFormat one should perform the following steps: Create a new DecimalFormat, using a ...

Read More »

Parse custom formatted date with SimpleDateFormat

Bipartite Graph

With this example we are going to demonstrate how to parse custom formatted date with SimpleDateFormat. SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner. It allows formatting (date -> text), parsing (text -> date), and normalization. In short, to parse custom formatted date with SimpleDateFormat you should: Create a new SimpleDateFormat, using a String ...

Read More »

Format date in custom formats with SimpleDateFormat

Bipartite Graph

This is an example of how to format a Date in custom formats, with the SimpleDateFormat. SimpleDateFormat can be used to format and parse dates. Formating a Date in custom format with the SimpleDateFormat implies that you should: Create a new Date. Create a new SimpleDateFormat, using a String pattern. The pattern describes the date and time format. Invoke the ...

Read More »