Skip to content

claudemartin/streamed-sql

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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