/** * Created a new instance of the Sql2o class. Internally this constructor will create a {@link GenericDatasource}, * and call the {@link Sql2o#Sql2o(javax.sql.DataSource)} constructor which takes a DataSource as parameter. * @param url JDBC database url * @param user database username * @param pass database password * @param quirks {@link org.sql2o.quirks.Quirks} allows sql2o to work around known quirks and issues in different JDBC drivers. */ public Sql2o(String url, String user, String pass, Quirks quirks) { this(new GenericDatasource(url, user, pass), quirks); }
public GenericDatasource(String url, String user, String password) { if (!url.startsWith("jdbc")){ url = "jdbc:" + url; } this.url = url; this.properties = new Properties(); set(properties,user,password); }
public Connection getConnection() throws SQLException { return DriverManager.getConnection(this.getUrl(), properties); }
public GenericDatasource(String url, String user, String password) { if (!url.startsWith("jdbc")){ url = "jdbc:" + url; } this.url = url; this.properties = new Properties(); set(properties,user,password); }
public Connection getConnection() throws SQLException { return DriverManager.getConnection(this.getUrl(), properties); }
public GenericDatasource(String url, String user, String password) { if (!url.startsWith("jdbc")){ url = "jdbc:" + url; } this.url = url; this.properties = new Properties(); set(properties,user,password); }
/** * Created a new instance of the Sql2o class. Internally this constructor will create a {@link GenericDatasource}, * and call the {@link Sql2o#Sql2o(javax.sql.DataSource)} constructor which takes a DataSource as parameter. * @param url JDBC database url * @param user database username * @param pass database password * @param quirks {@link org.sql2o.quirks.Quirks} allows sql2o to work around known quirks and issues in different JDBC drivers. */ public Sql2o(String url, String user, String pass, Quirks quirks) { this(new GenericDatasource(url, user, pass), quirks); }
public Connection getConnection() throws SQLException { return DriverManager.getConnection(this.getUrl(), properties); }
/** * Created a new instance of the Sql2o class. Internally this constructor will create a {@link GenericDatasource}, * and call the {@link Sql2o#Sql2o(DataSource)} constructor which takes a DataSource as parameter. * * @param url JDBC database url * @param user database username * @param pass database password * @param quirks {@link Quirks} allows sql2o to work around known quirks and issues in different JDBC drivers. */ public Sql2o(String url, String user, String pass, Quirks quirks) { this(new GenericDatasource(url, user, pass), quirks); }