List of usage examples for org.springframework.jdbc.datasource SimpleDriverDataSource SimpleDriverDataSource
public SimpleDriverDataSource(Driver driver, String url, Properties conProps)
From source file:annis.administration.DefaultAdministrationDao.java
private DataSource createDataSource(String host, String port, String database, String user, String password, boolean useSSL) { Properties props = new Properties(); String url = "jdbc:postgresql://" + host + ":" + port + "/" + database; if (useSSL) { props.put("ssl", "true"); }/*w w w .j a va 2 s . c o m*/ // DriverManagerDataSource is deprecated // return new DriverManagerDataSource("org.postgresql.Driver", url, user, password); props.put("user", user); props.put("password", password); // why is this better? // XXX: how to construct the datasource? return new SimpleDriverDataSource(new Driver(), url, props); }