![]() ![]() To find a driver for the database you want to use, simply do a web search for your database and JDBC. Close the connection when you're finished.Use the connection to issue SQL commands.Use the JDBC library to obtain a connection to the database.Ensure the JDBC driver you need is on your classpath.Install or locate the database you want to access.The steps for connecting to a database with JDBC are as follows: In this tutorial we'll use SQLite to get to know JDBC, mainly because it's so easy to use. One of the fortunate facts of programming in the Java ecosystem is that you will likely find a stable JDBC database connector for whatever database you choose. JDBC in the Java persistence layer Using JDBC to connect to a database Beneath that is the JDBC-compliant driver for the database you are using.įigure 1 is an architectural overview of JDBC in the Java persistence layer. JDBC is the common API that your application code interacts with. The JDBC driver supports communication between the JDBC manager and the database driver.The JDBC API supports communication between the Java application and the JDBC manager.The JDBC interface consists of two layers: Developed as an alternative to the C-based ODBC (Open Database Connectivity) API, JDBC offers a programming-level interface that handles the mechanics of Java applications communicating with a database or RDBMS.
0 Comments
Leave a Reply. |