Skip to content

Commit b514d8e

Browse files
committed
Add convenience method for creating connections
1 parent 6658a2c commit b514d8e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

modules/jdbc/src/main/java/org/testcontainers/containers/JdbcDatabaseContainer.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,17 @@ public Driver getJdbcDriverInstance() throws NoDriverFoundException {
207207
return driver;
208208
}
209209

210+
/**
211+
* Creates a connection to the underlying containerized database
212+
* instance without any parameters.
213+
*
214+
* @return a Connection
215+
* @throws SQLException if there is a repeated failure to create the connection
216+
*/
217+
public Connection createConnection() throws SQLException, NoDriverFoundException {
218+
return createConnection("");
219+
}
220+
210221
/**
211222
* Creates a connection to the underlying containerized database instance.
212223
*

0 commit comments

Comments
 (0)