Questions tagged [csvjdbc]

A JDBC driver to access CSV files.

CsvJdbc is a JDBC driver that allows read only access on CSV ("comma separated values)" files through SQL.

Homepage: http://csvjdbc.sourceforge.net/

10 questions
1
vote
1 answer

Is it possible to get the directory of a class package within a .jar?

I am trying to get the directory of a class package as a File within my .jar (the hierarchy is /controller/core): File directory_file_of_package = new File(getClass().getResource("/controller/core").toURI()); Which works when I run the program…
ryvantage
  • 13,064
  • 15
  • 63
  • 112
1
vote
2 answers

CSVJDBC - Interpreting Strings Instead of Integers in Aggregate Functions

I am using the CSVJDBC driver for retrieving results from CSV files. All record fields are interpreted as Strings. How can I utilise the MAX aggregate function in order to obtain the maximim Integer of a column? As far as I know, csvjdbc does not…
Stefan
  • 679
  • 2
  • 9
  • 21
1
vote
2 answers

Nested Queries using CSVJDBC

i am trying to perform a nested query using csvJDBC. The tables in question has the following attributes: comp(comp_id, comp_description) work_opportunities(wo_id, jp_id) link_wo_comp (wo_id, comp_id) The query is: SELECT comp_id,…
Style
  • 67
  • 9
1
vote
1 answer

Can we filter CSV files using CsvJdbc where two columns are equal?

I am trying to use a query that compares two column values, e.g., Select * from table where header1 = header2 but it does not seem to be working for me. Is this supported in CsvJdbc?
0
votes
3 answers

How to simplify this java for each loop?

I'm trying to simplify the following code. while(results.next()) for(String column : colNames){ if(EmptyUtil.isEmpty(results.getString(column))) { emptyCount++; } } if(emptyCount == colNames.size()){ …
Amila Fonseka
  • 392
  • 1
  • 5
  • 15
0
votes
0 answers

csv jdbc Like where clause failing

I have successfully used the csvjdbc1.0-35 for all of my database retrieval requirements with the exception of the where fieldName Like value% clause. I am connecting to a file system as served via http. Below is my connection sequence selectPhrase…
0
votes
0 answers

using csvJDBC with mapreduce

I want to execute Select query on CSV file using csvJDBC with MapReduce. I'm using the following code in a Map-Only function, but the output file is empty: public void map(LongWritable key, Text value, Context context) throws IOException,…
0
votes
1 answer

Read multiple csv file with CsvJdbc

I need to bind a group of csv file in the format "YYYY-MM-DD hh:mm:ss.csv" that are present in the same folder with a unique table that contains all the data present in all the files. I need to read the data from a Java EE application thus I would…
Gryth36
  • 3
  • 3
0
votes
1 answer

java.sql.SQLException: Syntax Error

I'm getting this error message below when I query a CSV file (using relique CsvDriver). java.sql.SQLException: Syntax Error. Encountered " "GROUP "" at line 1, column 105. Was expecting one of: "AND" ... "OR" ... "ORDER" ... …
JungleJap
  • 1
  • 1
-1
votes
2 answers

How to use > or < in Header name in SQL query?

I'm facing a problem while validating a csv file. I'm using the csvJdbc api for validating csv. But in CSV, there is a header which contains the '>' sign. When I try to use that header for validation, it throws an exception. Is there any way to use…