Mar
4
2012

What is JDBC or Java Database Connectivity?

Java Database Connectivity is basically a framework that supports the programs in order to access files from databases, flat files and spreadsheets. The Java database connectivity works by making connections with the user program and transforming into a “backstage” access to the database, regardless of the type of database management system used. Moreover, Java Database Connectivity is an application program interface for Java programs that allows users to gain access on pertinent data by the use of queries. With the use of the Java Database Connectivity, the user will have the opportunity to update significant information within the database.

Java Database Connectivity is significantly a part of the Java Program. This tool is primarily used to allow multiple procedures and continue to allow these procedures to be used by the same application. With the help of the drive manager, the Java Database Connectivity will be established correctly.

What is JDBC or Java Database Connectivity? java duke

How to Use the Java Database Connectivity Driver

Connecting to a database or platform will be easy with the use of the Java Database Connectivity (JDBC). Regardless of the type of database and platform, you can effectively use the Java Database Connectivity. All you need to do is assess the capacity of your database and choose the most appropriate platform you’re going to use. You can choose either oracle, Informix, Microsoft, MySQL and other platforms available in the market. Installed in these platforms are the JDBC drivers that you can use to connect and manipulate the items in the database. You can download the JDBC driver that comes with the database platform. The JDBC driver will come with instruction that you should follow specifically. Make sure that the installation is well in place, so you can activate your drive manager to gain access to the database even in a Java program.

How to Connect to the Database Using the JDBC

To gain access to your database, you need to retrieve an object of the “connection” class from your driver manager. You’ll definitely need a URL and parameters for the database and access controls respectively. These controls usually include the username or authentication as well as the password. An example of a URL in a java database – jdbc: mysql://db_server:3315/contacts/. Although a Java URL seems different than a normal URL, they’re actually the same. They have the same protocol, machine number and host name. If security is not an issue, you can probably access to databases easily. All you need to have is the authentication name, password and a database account.

In using the Java Database connection, you need to learn how to manipulate certain files. You need to learn how to structure the elements and develop query statements. Keep in mind that when you’re using the SQL statements, you can use the INSERT, DELETE and UPDATE commands, but in Java Database Connections, you should remember that they’re represented by a statement (delivered to the database every time), prepared statement (predetermined and is allowed to be executed several times) and callable statements (executes stored procedures).



2 Comments + Add Comment

Advertisements