Skip to content

Latest commit

 

History

History
53 lines (31 loc) · 2.23 KB

README.adoc

File metadata and controls

53 lines (31 loc) · 2.23 KB

Vert.x SQL Client examples

Here you will find examples demonstrating the usage of the Vert.x SQL Client (aka Reactive SQL Client).

Simple

This example shows the basic functionality of the SQL client, it demonstrates how to connect to a database, perform basic data definition queries by creating a test table plus test data, after it shows how to perform simple queries without parameters and shows how to close the connection.

Query Params

This is a follow up to the Simple example. In this example you will see how to write queries with parameters, the advantage of doing so is to avoid common SQL injection security issues since all parameters are used in a PreparedStatement before being sent to the database engine.

Streaming

This is a follow up to the Simple example. In this example you will see how to read results as a stream instead of fetching them all in memory. This is particularly useful when you expect large results.

Transaction

The Transaction example show how to execute queries with a transaction using the asynchronous SQL client.

Transaction Rollback

The Transaction rollback example is a modified version of the simple Transaction example. In this example, we manage the transaction manually and, after inserting data, we rollback the changes. The result should be an empty list.

Template

The Template example show how to execute SQL templates.

Template mapping

The Template mapping example show how to execute SQL templates mapped to query params or database rows