Skip to content

Commit 286ba6e

Browse files
committed
Merge branch 'master' of github.com:ebean-orm/ebean-datasource-api
2 parents d994398 + 49f4441 commit 286ba6e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
11
# ebean-datasource-api
22
java.sql.DataSource service API
3+
4+
5+
6+
### Example use:
7+
8+
```java
9+
10+
DataSourceConfig config = new DataSourceConfig();
11+
config.setDriver("org.postgresql.Driver");
12+
config.setUrl("jdbc:postgresql://127.0.0.1:5432/unit");
13+
config.setUsername("foo");
14+
config.setPassword("bar");
15+
16+
17+
DataSource pool = DataSourceFactory.create("app", config);
18+
19+
```
20+
21+
22+
### Robust and fast
23+
24+
This pool is robust in terms of handling loss of connectivity to the database and restoring connectivity.
25+
It will automatically reset itself as needed.
26+
27+
This pool is fast and simple. It uses a strategy of testing connections in the background and when connections
28+
are returned to the pool that have throw SQLException. This makes the connection testing strategy low overhead
29+
but also robust.
30+
31+
32+
33+
### Mature
34+
35+
This pool has been is heavy use for more that 10 years and stable since April 2010 (the last major refactor to use `java.util.concurrent.locks`).
36+
37+
This pool was previously part of Ebean ORM with prior history in sourceforge.
38+
39+
There are other good DataSource pools out there but this pool has proven to be fast, simple and robust and maintains it's status as the preferred pool for use with Ebean ORM.
40+

0 commit comments

Comments
 (0)