Skip to content

claudemartin/streamed-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

streamed-sql

Use Java Stream API for your JDBC queries.

It's very easy to use:

Connection conn = dbpool.getConnection();
var strsql = StreamedSQL.create(conn, true); 
try (Stream<Foo> stream = strsql.stream("SELECT * FROM FOO", Foo::new)) {
  stream.filter(f -> f.getName().startsWith("L")).sorted().forEachOrdered(System.out::println);
}

You get a stream and you can just map the data to any POJO and then process them as a stream.
In this example strsql is set to use a default connection and return parallel streams.

See Example.java for more details and read the javadoc.

This is based on an idea I found on Stackoverflow: https://stackoverflow.com/a/32232173/2123025

About

Use Java Stream API for your JDBC queries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages