jdbi Questions

3

Solved

Are both functions sanitized / safe against SQL injection? For example, consider the following: @SqlUpdate("INSERT INTO <tableName> (<columns>) VALUES (<values>)") public abstra...
Allrud asked 12/1, 2017 at 19:2

4

Solved

I want to dynamically filter a JDBI query. The a list of parameters is passed from the UI via REST e.g. http://localhost/things?foo=bar&baz=taz http://localhost/things?foo=buz Which is (clu...
Porush asked 1/4, 2016 at 15:4

1

Solved

Has anyone else also noticed changes in Java's generics in Java 21? We're using Jdbi for database access and when updating to Java 21 things go wrong because a generic type cannot be determined any...
Reddin asked 16/11, 2023 at 15:21

2

Solved

How I can create dynamic where public interface ThingDAO { @SqlQuery("SELECT * FROM things <where>) List<Thing> findThingsWhere(@Define("where") String where); } JDBI How can I dyn...
Haeres asked 18/10, 2018 at 8:55

2

According to JDBI document https://jdbi.org/#_jackson_2, it seems that it's quite straight forward to have a json property of your object model, however I've tried the following and it ran into man...
Lenrow asked 11/10, 2020 at 2:14

5

How can I execute somethings like this in jDBI ? @SqlQuery("select id from foo where name in <list of names here>") List<Integer> getIds(@Bind("nameList") List<String> nameList);...
Aborticide asked 17/10, 2013 at 10:45

3

Solved

I'm wondering if/how this is possible, if it is, I'm sure its a simple fix that I can't seem to figure out @SqlQuery("SELECT * FROM Table WHERE column LIKE '%:thingName%'") public Set<Things&gt...
Walling asked 31/5, 2013 at 21:8

3

We have an SQL statement which is executed by Jdbi (org.skife.jdbi.v2). For binding parameters we use Jdbi's bind method: Handle handle = ... Query<Map<String, Object>> sqlQuery = hand...
Maryn asked 11/9, 2015 at 14:46

2

Is it possible to have optional (null) parameters with jDBI queries? I'm attempting to get optional parameters working in a database query. I am working with dropwizard. @SqlQuery("SELECT * \n" +...
Interlace asked 29/10, 2014 at 18:37

2

Solved

I am consistently getting the following exception below when inserting values using JDBI's @BindBean into my Mysql database within Dropwizard. The problem seems to be that JDBI is unable to find th...
Archy asked 6/3, 2016 at 6:16

1

Solved

I am using JDBI in tandem with Spring Boot. I followed this guide which results in having to create a class: JdbiConfig in which, for every dao wanted in the application context, you must add: @Be...
Kissable asked 30/4, 2020 at 15:18

3

I want to know what exactly sql query is processed by jdbi sql api for debugging purposes. My interface class is following public inteface myinteface{ @SqlQuery("select :c1 from tablename where ...
Descry asked 9/5, 2014 at 12:12

2

Solved

I know there is @GeneratedKeys, but I can't use it with a handler (I am using a handler in my tests).
Delvalle asked 13/7, 2016 at 16:47

4

Solved

I'm creating a simple REST application with dropwizard using JDBI. The next step is to integrate a new resource that has a one-to-many relationship with another one. Until now I couldn't figure out...
Deficiency asked 20/6, 2014 at 23:34

1

My question is similar to this PostgreSQL check if array contains any element from left-hand array but I want to execute (same query which is given in the above question) i.e. "&& operato...
Capita asked 27/5, 2018 at 18:35

1

Solved

I'm trying to figure out how to do multi-row insert statements with JDBI. Here is what I've got: @SqlBatch("INSERT INTO my_table(col1, col2) VALUES (:col1, :col2)") @BatchSize(size=300) public ab...
Actinal asked 20/12, 2017 at 23:26

5

Solved

I hava two jdbi dao like these: public interface dao1 { @Query("insert into table1 ...") findByid(myBean1); } public interface dao2 { @Query("insert into table2 ...) save(myBean2; } } i wa...
Lyricist asked 30/11, 2015 at 14:47

3

Solved

I execute sql queries as transactions using jdbi inTransaction() function. I would like to know how/what type of locking mechanism is used internally. additionally, is the whole table locked during...
Reticulum asked 16/11, 2011 at 20:28

3

Solved

How do you do ordering with SQL Object Queries in JDBI? I want to do something like: @SqlQuery( "SELECT * FROM users " + "WHERE something = :something " + "ORDER BY :orderBy :orderDir" ) List&...
Godbey asked 28/5, 2013 at 11:9

3

Solved

I've been moving an existing project from jdbc to jdbi, and I've been making much use out of jdbi's beautiful SQL Object API. We're using mysql. While the SQL Object API can construct handled quer...
Refractometer asked 5/9, 2013 at 17:52

1

Solved

I'm using Dropwizard framework with JDBI and h2-in-memory for my test purposes. Also I've written my DAOs, and now I want to test them with unit tests. I came along the DBUnit which seem to fit my ...
Francefrancene asked 6/3, 2016 at 9:47

2

Solved

I tried using SELECT COUNT(*) FROM :TableName; And in JDBI I used .bind("Tablename", "MyTable") The result is always inside single quotes: SELECT COUNT(*) FROM 'MyTable'; Is there a prop...
Fenugreek asked 13/5, 2014 at 3:8

2

Solved

I'm trying to do a IN query using MYSQL JDBI on Dropwizard (not relevant, I assume). @SqlQuery("SELECT id FROM table where field in (<list>)") List<Integer> findSomething(@BindIn("lis...
Bifoliolate asked 20/10, 2015 at 15:50

2

Solved

I am playing with dropwizard and I want to build a REST application that has various foreign-key relations in the entities. For example given the following 3 tables: -- table persons CREATE TABLE...
Vertigo asked 1/10, 2014 at 3:40

2

Solved

Does JDBI support binding of enum types via annotation? For example, assuming a DAO that included a method: @SqlQuery("select count(*) from answer a where a.foo = :foo") Long someSqlQuery(@Bind("...
Brandonbrandt asked 29/4, 2015 at 19:33

© 2022 - 2024 — McMap. All rights reserved.