Commit 17c4a920 by Patryk Czarnik

Program pokazujący zalezności

parent 5e8795ab
package abc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Program {
public static void main(String[] args) {
try(Connection c = DriverManager.getConnection("jdbc:postgresql://localhost/hr", "alx", "abc123")) {
System.out.println(c);
// Tego mógłbym użyć, gdyby zależność do Postgresql nie była w scope runtime, tylko domyślnie (compile)
// org.postgresql.jdbc.PgConnection pgc = (org.postgresql.jdbc.PgConnection) c;
// String s = pgc.escapeLiteral("'Ala powiedziała 'to jest spoko' i tyle'");
// System.out.println(s);
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment