27 Nisan 2023 Perşembe

JDBC DriverManager Kullanımı

Örnek
Şöyle yaparız
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class Example {
  public static void main(String[] args) throws SQLException {
    String url = "jdbc:mysql://localhost:3306/mydatabase";
    Properties props = new Properties();
    props.setProperty("user", "myusername");
    props.setProperty("password", "mypassword");
        
    try (Connection conn = DriverManager.getConnection(url, props)) {
       // Use the connection...
    }
  }
}

Hiç yorum yok:

Yorum Gönder

Soft Delete

Giriş Açıklaması  şöyle When using the soft delete mechanism on the database, you might run into a situation where a record with a unique co...