This>3.5.1</version> </dependency>
Gradle (in your
build.gradle file):
compile 'io.vertx:vertx-jdbc-client:3.5.1'
There are several ways to create a client. Let’s go through them all.:
def.
You can create a client specifying a data source name as follows
def.
def:
def client = JDBCClient.create(vertx, dataSource)({ res -> if (res.succeeded()) { def connection = res.result() connection.query("SELECT * FROM some_table", { res2 -> if (res2.succeeded()) { def but if you want to use a different provider you can override
this property and provide your implementation.
row_stream_fetch_size
The size of
SQLRowStream internal:
BoneCP
Hikari
Similar to C3P0 they can be configured by passing the configuration values on the JSON config object. For the special
case where you do not want to deploy your app as a fat jar but run with a vert.x distribution, then it is recommented
to use BoneCP:
def config = [ url:"jdbc:hsqldb:mem:test?shutdown=true", driver_class:"org.hsqldb.jdbcDriver", max_pool_size:30 ] def.
Due to the fact that Vert.x uses JSON as its standard message format there will be many limitations to the data types accepted by the client. You will get out of the box the standard:
null
boolean
number
string
There is also an optimistic cast for temporal types (TIME, DATE, TIMESTAMP) and optionally disabled for UUID. UUIDs are supported by many databases but not all. For example MySQL does not support it so the recommended way is to use a VARCHAR(36) column. For other engines UUID optimistic casting can be enabled using the client config json as:
{ "castUUID":.