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

CREATE EVENT - Scheduled Task İçindir

Örnek Şöyle yaparız CREATE EVENT myevent     ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR     DO       UPDATE myschema.mytable SET myc...