Home » sql » Page 7

Tag Archives: sql

Commit/Rollback transaction example

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

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

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

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 »