Ö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