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
7
votes
2 answers

How to get generated keys with commons dbutils?

I don't understand how to get auto generated keys with commons-dbutils?
Plastic Rabbit
  • 2,859
  • 4
  • 25
  • 27
6
votes
1 answer

How do I query for a List using DBUtils?

Looking over the DBUtils API docs, I cannot see if it's possible to query for a List in the same way that I could query a List using BeanListHandler. I could either do it be creating a Bean that wraps the String and use…
herrtim
  • 2,697
  • 1
  • 26
  • 36
5
votes
3 answers

Apache Dbutils changing column name in update Sql

I am having a strange problem with Dbutils , I am trying to run a parameterized update sql, I am supplying correct number of arguments , but dbutils is modifying the timestamp column name by changing the name of modifying it when timestamp…
user482963
  • 342
  • 6
  • 17
5
votes
1 answer

DBUtils QueryRunner instantiation

I have a webservice that instantiates a single QueryRunner with a data source on initialization. It uses this one QueryRunner object for all servlet requests from multiple different servlets used by the webapp by passing it around as a servlet…
egerardus
  • 11,316
  • 12
  • 80
  • 123
4
votes
1 answer

Azure Databricks Notebook unable to find "dbutils" when it is in package

I am creating a class in for communicating with azure storage blobs and it is working fine but if I try to put this class in package it is giving me an error "error: not found: value dbutils". It is working fine if I remove the "package…
4
votes
0 answers

JDBC connection suddenly starts checking strict type and throwing java.sql.SQLException with incompatible types

I am having intermittent issue when executing a simple COUNT(*) stored procedure from Java. I am getting below java.sql.SQLException with incompatible types. See the example stored procedure which is not doing much except COUNT(*). The weird thing…
3
votes
2 answers

Using QueryRunner to insert ArrayList

I want to use QueryRunner to perform an insert of an ArrayList. The only information I am finding online is for inserting one Object[]. Something along the lines of: qr.update("insert into MyTable (param1,param2,param3) values (?,?,?)", new Object[]…
Ken
  • 31
  • 1
  • 4
3
votes
3 answers

Create a dataframe out of dbutils.fs.ls output in Databricks

So, I'm a beginner and learning spark programming (pyspark) on Databricks - What am I trying to do ? List all the files in a directory and save it into a dataframe so that I am able to apply filter, sort etc on this list of files. Why ? Because I am…
skrprince
  • 81
  • 1
  • 4
3
votes
1 answer

BeanListHandler from dbutils library cannot create java class objects from a database resultset

I have created a class called Product and a table having the same name (Product) in apache derby database. Now i want to get the corresponding Product objects whenever i retrieve the rows from the database using BeanListHandler but always get an…
geobudex
  • 536
  • 1
  • 8
  • 24
3
votes
0 answers

How to get Double.NaN for NULL (numeric) value from PostgreSQL in Java

I need to know if value (numeric) in Java ResultSet from PostgreSQL is NULL and if so, I would need to get Double.NaN instead of 0. I use Apache Commons DBUtils mapping but it maps NULL value to 0. Is there some way how to get Double.NaN instead…
jnemecz
  • 3,171
  • 8
  • 41
  • 77
3
votes
2 answers

DBUtils fails to fill fields of a Java Bean

I have a mysql table like this: CREATE TABLE `sezione_menu` ( `id_sezione_menu` int(11) unsigned NOT NULL AUTO_INCREMENT, `nome` varchar(256) NOT NULL DEFAULT '', `ordine` int(11) DEFAULT NULL, PRIMARY KEY (`id_sezione_menu`) )ENGINE=InnoDB…
nap.gab
  • 451
  • 4
  • 19
3
votes
2 answers

Apache DBUtils and scalar value

I need to get scalar value with DBUtils, does someone know how to get it? Currently I do: String sql = "SELECT count(*) FROM t1 WHERE cod = ?"; final QueryRunner run = new QueryRunner(new AppDataSource()); ScalarHandler scalar = new…
1ac0
  • 2,875
  • 3
  • 33
  • 47
3
votes
0 answers

Properly use of BeanListHandler when join tables

I'm using DBUtils in my simple project. I have Item and Person entity class (persons and items as tables in database). This simplified the class to better show what I mean. Now i need to get list of items with login names using BeanListHandler. To…
marioosh
  • 27,328
  • 49
  • 143
  • 192
2
votes
0 answers

Apache DBUtils: Standard way to handle different datatype returned from SQL (INT/NULL)?

Is there a standard proper java code to properly handle the following datatype which the result may possible returned as integer or null? I'm using common-dbutils to perform query execution. --MSSQL QUERY ="select ID from Users where Name='test'"…
2
votes
0 answers

Java DbUtils MySQL How set param when call a stored procedures

I have a probleme with call a procedure, I want to set two paramams. In procedure first param have to be a int and secod time. I did this : beans = (List) qRunner.query(conn, "call mpklocal.LCD_GetDispInfoChange_TEST(?, CURTIME() )", timtableId , …
Krzysztof Pokrywka
  • 1,356
  • 4
  • 27
  • 50
1
2 3 4 5 6