JDBC / CATATAN</>↗JDBC12 Jan 2026
In modern Java (specifically JDBC 4.0 and later), you generally do not need to write code to load the driver. The DriverManager uses the Service Provider Interface (SPI) to automatically discover and load any JDBC drivers present on your classpath. 1. The Modern Way: Automatic Discovery As long as the driver JAR is on your […]
JDBC / CATATAN</>↗JDBC12 Jan 2026
To connect to Microsoft SQL Server using JDBC, you’ll need the Microsoft JDBC Driver for SQL Server. Using Maven, you can add the dependency and use the DriverManager to establish a connection. Here is the step-by-step process: 1. Add the Dependency Add the following dependency to your pom.xml file: <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>mssql-jdbc</artifactId> <version>12.8.1.jre11</version> <!– Check […]
JDBC / CATATAN</>↗JDBC11 Jan 2026
To connect to an Oracle database using JDBC, you’ll need the Oracle JDBC driver (typically ojdbc8.jar or later) and a connection string formatted as a Thin URL. Here is the step-by-step process and a code example. 1. Add the Dependency If you are using Maven, add the ojdbc dependency to your pom.xml. For Java 11+, […]
JDBC / CATATAN</>↗JDBC11 Jan 2026
To connect to a PostgreSQL database using JDBC, you’ll need the PostgreSQL JDBC driver and a properly formatted connection URL. 1. Add the Dependency Add the following dependency to your pom.xml file: <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>42.7.4</version> </dependency> 2. Establish the Connection In modern JDBC (4.0+), you no longer need to manually call Class.forName(). The DriverManager […]
JDBC / CATATAN</>↗JDBC10 Jan 2026
Connecting to a MySQL database using JDBC involves a few straightforward steps: adding the driver, defining your connection credentials, and using the DriverManager to open a session. 1. Add the MySQL Connector Dependency First, ensure you have the MySQL JDBC driver in your project. If you are using Maven, add this to your pom.xml: <dependency> […]
JDBC / CATATAN</>↗JDBC10 Jan 2026
Setting up JDBC (Java Database Connectivity) involves a few key steps: adding the database driver to your project, establishing a connection, and executing your SQL statements. 1. Add the JDBC Driver Dependency First, you need the driver for your specific database (e.g., MySQL, PostgreSQL, H2) in your pom.xml. For MySQL, you would add: <dependency> <groupId>com.mysql</groupId> […]