Questions tagged [apache-commons-dbutils]

Apache Commons Dbutils is a toolkit that simplifies the usage of the Java Database Connectivity (JDBC) API.

Apache Commons DbUtils is a component of the Apache Commons project. Apache Commons DbUtils is library that simplifies JDBC programming and is open source software distributed under the Apache License, Version 2.0.

86 questions
2
votes
1 answer

Can apache-commons-dbutils covert beans to an SQL statement?

As a newbie to Servlet programming, I think I may not have gotten something right here: I understand the concept of Java Beans and little ORM helper classes like org.apache.commons.dbutils.DbUtils. I can convert a ResultSet into an instance of my…
cirko
  • 211
  • 2
  • 13
2
votes
5 answers

How to map database column names to Java class fields using apache-commons-dbutils

I would like to populate a POJO (State.java) from DB using Apache DBUtils library. However, since the names of the Bean properties do not match exactly with DB column names some of the properties are left unfilled. Now, I did some research on this…
Nital
  • 5,784
  • 26
  • 103
  • 195
2
votes
2 answers

How to call a SQL Scalar function using Apache DbUtils

I am trying to call a SQLServer stored Scalar function through Apache Common DbUtils. I tried something like this: run.query("SELECT [MyDB].[dbo].[test] ('testParam')", new ScalarHandler()); But, I get this…
2
votes
2 answers

Generic type fumbling on reusable JavaFX data retrieval Service with DbUtils BeanListHandler

I'm attempting to create a generic JavaFX Service that will use DbUtils' BeanListHandler to hand an ObservableList back to the app GUI thread. The intention is to reuse it to load many tables into many different lists of different bean classes. The…
2
votes
1 answer

How to transform DBUtils resultset into JavaBeans composited from more domain objects?

I am creating MVC web application in Spring Framework and I need to transform rows from Apache DBUtils resultset into JavaBeans that is composed from nested objects. With respect to a very few examples I found I created this RowProcessor…
user2148736
  • 1,283
  • 4
  • 24
  • 39
1
vote
0 answers

How to connect JDBC - snowflake that has private key authentication using Spring boot configuration xml via HikariCP connection pool?

I tried using HikariCP connection pool to connect snowflake using JDBC. I use Spring Boot configuration XML file to create a bean. I have the private key for my authentication. So I tried the following, Properties…
1
vote
0 answers

ResultSetHandler problems in multithreaded parallel queries

I am trying to make several read queries in parallel in Oracle database from a Java application. I use CallableTasks to make these queries. The sample of the Callable Task is as follows: public class MyCallableTask implements Callable> { …
1
vote
1 answer

Can I Insert Records into a SQL Table passing a bean as values using Apache Commons DBUtils

I am using Java to access a MS SQL server. I am looking for a simple way to import data into various tables without having to write large sql querys. Some of these tables have 30 some columns. I found the apache commons dbutils library and it…
Bitwyse1
  • 339
  • 3
  • 18
1
vote
1 answer

Need to stream large QueryRunner result to file, seems to be storing in memory

I'm trying to build a Java application that can stream very large result sets of arbitrary SQL SELECT queries into JSONL files, specifically through SQLServer but would like to run with any JDBC DataSource. In Python this would be easy to just treat…
Chet
  • 21,375
  • 10
  • 40
  • 58
1
vote
0 answers

Android - Apache Commons DbUtils - QueryRunner Exception

I'm using in my app Apache Commons DbUtils (https://commons.apache.org/proper/commons-dbutils/). I added jar file (commons-dbutils-1.7.jar) to the libs folder. Then I have this code: ResultSetHandler> h = new…
Pepa Zapletal
  • 2,879
  • 3
  • 39
  • 69
1
vote
0 answers

queryRunner insert adds a parameter

I'm trying to make an insert and get the auto generated id returned. This is an Oracle database. For that i am using org.apache.commons.dbutils.QueryRunner insert which returns the first column. The problem is i don't know for which reason i am…
1
vote
1 answer

How do I query for a Set using DBUtils?

Looking over the DBUtils API docs, I cannot see if it's possible to query for a Set. Which implementation of ResultSetHandler i should use for query Set of objects?
slvtn
  • 43
  • 6
1
vote
1 answer

method map in interface java.util.stream.Stream cannot be applied to given types;

The code listing: protected List getRows(String startDate, String endDate, Function func){ ConnectionManager cm = new ConnectionManager(); List rows = null; try(Connection c = cm.getConnection()) { …
kostas
  • 1,959
  • 1
  • 24
  • 43
1
vote
1 answer

rollback and commit only when not in auto-commit mode

The javadoc for Connection#rollback clearly states: This method should be used only when auto-commit mode has been disabled. A similar caveat exists for the commit method. However, looking at the code, e.g. in Apache commons DbUtils I see…
Marcus Junius Brutus
  • 26,087
  • 41
  • 189
  • 331
1
vote
1 answer

How to solve this sql string in Dbutils ?

public List list() throws SQLException { return list(0, Short.MAX_VALUE); } public List list(int start, int count) throws SQLException{ Connection c = this.getConnection(); …