Skip to content

Latest commit

 

History

History
104 lines (87 loc) · 1.96 KB

File metadata and controls

104 lines (87 loc) · 1.96 KB

Connector methods

execute

runs a write query that returns a key for insert's ID or update's affectedRows

val id = con.execute(query1).key
val ar = con.execute(query2).affectedRows

getOne

gets a single row of result providing a callback to build it

con.getOne(query) { rs ->
    Person(rs.getString("name"), rs.getTimestamp("birthdate"))
}

getList

gets a list of results providing a callback to build each row

con.getList(query) { rs ->
    Person(rs.getString("name"), rs.getTimestamp("birthdate"))
}

You can use ResultBuilder to help you organize your model build

exist

return true if there is any resulting row

con.exist(query)

getFirstInt

returns the first column of the first resulting row

con.getFirstInt(query)

getIntList

returns a list of the first column of each row

con.getIntList(query)

getFirstLong

returns the first column of the first resulting row

con.getFirstLong(query)

getLongList

returns a list of the first column of each row

con.getLongList(query)

getFirstDouble

returns the first column of the first resulting row

con.getFirstDouble(query)

getDoubleList

returns a list of the first column of each row

con.getDoubleList(query)

getFirstString

returns the first column of the first resulting row

con.getFirstString(query)

getStringList

returns a list of the first column of each row

con.getStringList(query)

getFirstDate

returns the first column of the first resulting row

con.getFirstDate(query)

getDateList

returns a list of the first column of each row

con.getDateList(query)

getFirstBoolean

returns the first column of the first resulting row

con.getFirstBoolean(query)

getBooleanList

returns a list of the first column of each row

con.getBooleanList(query)