title: Import csv in h2 dynamically
body: <p>I'm searching for a solution to Import any csv file with Java (or SQL computed with a Java application at runtime) in a h2 database. a possibility could be to write at first a dynamic file and run the "script" on h2 databse connection after creation.
  my main Problem is that i create the csv files dynamically and the column number and Label values can differ. the Environment for getting Connection, run a scribt on h2 and create the files during application is running are still exists.</p>
  
  <p>for now i found many Solutions if i know the csv structure but i didn't can know it before. another Problem is that the typ is not ever sure(if it is easier to find a solution let as say all are double.</p>
  
  <p>the reason why i Need this is, that i wanna Show the dataset in a graph (linechart). sometimes i Need the first two rows as x axis. sometimes i have to Show one line sometimes more(so in csv there are one ylabel or more)</p>
  
  <p>the reason why I wanna have this data in a database is i ever wanna Show min max and avg of this set based on the x axis criteria. (smt. Show per month, day, week). so the idea is to set a date Format by creating the data and by reading for the Chart i Group by <code>DATE(DATE,TIME)</code>, the data.</p>
  
  <p>examples:
  my base csv example</p>
  
  <pre><code>DATE,TIME,label1  ,  y2       ,line3  ,...  (labelNames have no equality)
  
  20160101,0115, any int,any double ,any int,...
  
  20160101,0130, ...    , ...       , ...   ,..   (if there is no messure 
  
  20160101,0145, ...    ,  .....    , ---   ,..    the placefolder is '---')
  
  20160101,0200, ....
  
  20160102,...
  </code></pre>
  
  <p>so sometimes my resulting csv seems like:</p>
  
  <pre><code>DATE,TIME,label1,y2
  </code></pre>
  
  <p>or like this:</p>
  
  <pre><code>DATETIME,label1,y2
  </code></pre>
  
  <p>or this:</p>
  
  <pre><code>DATE,y2,another4
  </code></pre>
  
  <p>We can be sure that all lines have same length. labels are at first line. I hope you get the idea. if you have a better solution to solve it i also would listen to that!(sry for the style have no idea how to make a table)</p>
  
  <p>thanks for any command!</p>