preparing for db connection
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -3,6 +3,9 @@ package de.srsoftware.cal.app;
|
||||
|
||||
import de.srsoftware.cal.importer.jena.Kassablanca;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Test application
|
||||
@@ -16,8 +19,20 @@ public class Application {
|
||||
* @param args default
|
||||
*/
|
||||
public static void main(String[] args) throws NoSuchAlgorithmException {
|
||||
var importer = new Kassablanca();
|
||||
var appointments = importer.fetch();
|
||||
appointments.forEach(System.out::println);
|
||||
|
||||
String host = null;
|
||||
String database = null;
|
||||
String user = null;
|
||||
String pass = null;
|
||||
int port = 3306;
|
||||
|
||||
// TODO: we need configuration here!
|
||||
|
||||
try (Connection con = DriverManager
|
||||
.getConnection("jdbc:mysql://%s:%s/%s".formatted(host,port,database), user, pass)) {
|
||||
// use con here
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user