java - Jooq not throwing exception for failures -


i using jooq populate csv data db. if provide "string value" instead of int not entering value db in mean time not throwing error also. how know if upload failed or not.how handle these type of exceptions.in addition there way check/throw warning if try give string in int column.

version : 3.8.x

connection connection = getconnection() try(connection connection = getconnection()) {             dslcontext create = dsl.using(connection, sqldialect.mysql);              create.loadinto(tables.process_queue_map)                     .loadcsv(new file("/my/folder/testinput.csv"))                     .fields(tables.process_queue_map.process_queue_id,                             tables.process_queue_map.process_name,                             tables.process_queue_map.queue_name,                             tables.process_queue_map.markeptlace,                             tables.process_queue_map.queue_type,                             tables.process_queue_map.created_by,                             tables.process_queue_map.created_time,                             tables.process_queue_map.last_modified_by,                             tables.process_queue_map.last_modified_time)                     .execute();          } catch(exception ex) {             ex.printstacktrace();         }     } 

general failure handling loader api

the loader api default throws kinds of exceptions raised underlying database or jdbc driver. can configured , overridden specifying:

this affects jdbc errors, not data loading "errors"

jooq's auto-conversion

for historic reason, throughout jooq api, automatic conversion between data types "lenient" instead of "fail-fast". data type conversion passes through convert utility, returns null in case data type conversion fails. e.g. when calling convert.convert(object, class), following test pass:

assertnull(convert.convert("abc", int.class)); 

this has been criticised in past, cannot changed in jooq api due backwards compatibility.

workarounds include:


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -