Questions tagged [jdbi]

jDBI is an extension library over standard JDBC, to make writing relational database access more convenient (and correct!) from Java.

jDBI is a Java library that builds on JDBC to offer more convenient, light-weight access to relational databases. It aims to make database access more convenient and correct by building simple abstractions on top of raw JDBC.

384 questions
0
votes
2 answers

NoSuchMethodError JDBI

I am trying to create a table something in my class using such method: void createTab() { DBI dbi = new DBI(DBURL, DBUSER, DBPASS); BindExamples dao = dbi.open(BindExamples.class); dao.createSomethingTable(); dao.close(); } My BindExamples…
k4sia
  • 414
  • 1
  • 6
  • 18
0
votes
1 answer

using pre defined mapper class in new mapper class jdbi sql fluent queries

How I can implement predefined mapper class of an class into the new mapper class of another class which have first class as object public class Class2Mapper implements ResultSetMapper { public Class2 map(int index, ResultSet rs,…
Dheerendra
  • 1,488
  • 5
  • 19
  • 36
0
votes
3 answers

Delete item from database after X days

I am trying to make a Java Thread, this thread have to delete from an MySQL database all the records, older than 7 days. In my table i have a column that contain the date like this: 2013-10-28 17:00:00 . And to do this i want to use JDBI library.…
Ahmadhc
  • 173
  • 1
  • 13
-1
votes
1 answer

JDBI 3 in DropWizard, onDemand reusing connection

Trying to figure out this case from the documentation: http://jdbi.org/#_attached_to_handle Say you have SomeClass dao1 = dbi.onDemand(SomeClass.class) then you have something in another method, other place: try ( Handle handle = dbi.open(); )…
mjs
  • 21,431
  • 31
  • 118
  • 200
-1
votes
1 answer

JBDI - Eating up part of the SQL statement

This is my JDBI method @Override @SqlQuery("SELECT * FROM " + TABLE_NAME + " WHERE " + COLUMN_CAMPAIGN_ID + " = :campaignId AND " + COLUMN_STATUS + " = 0 AND " + COLUMN_STAGE_ID + " IS NULL AND " + COLUMN_MODIFICATION_DATE …
Aakash Verma
  • 3,705
  • 5
  • 29
  • 66
-1
votes
1 answer

Dynamic bind select values in MySQL query jdbi

How can i write dynamic SQL query in Jbdi, like in my project customer will ask some details like first name,last name,mobile. so i will read those values into string and my idea was directly append that to SQL query dynamically like select first…
Nike
  • 5
  • 6
-2
votes
2 answers

"org.jdbi.v3.core.statement.UnableToCreateStatementException: Undefined attribute for token ''

Method in Dao Interface @RegisterRowMapper(MapMapper.class) @SqlQuery( "SELECT Table1.tenantId,Table1.sacTenantId, sacLogId,currentStep,status from Table1 inner join Table2 on Table1.tenantId = Table2.tenantId where…
-2
votes
1 answer

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax near 'OPTION SQL_SELECT_LIMIT=DEFAULT'

This query return below error. Any one has any idea ??? @SqlQuery("SELECT * FROM employee WHERE id = (:id) ") Employee getByid(@Bind("id") Integer id); result: 2018-08-29 11:12:19.532 ERROR 9736 --- [nio-8080-exec-5]…
SSSS
  • 205
  • 2
  • 8
  • 18
-3
votes
2 answers

Date field not giving value in correct format

In List> values, I am taking values from database. Database side i ahve used defaultMapper to map values. Now when I am fetching the values, only one Date type of field is not giving correct result in values above. Date is coming…
user2986404
  • 121
  • 1
  • 1
  • 4
1 2 3
25
26