title: What I should improve in my code to migrate data from csv file to database
body: <p>I have a CSV file with the following layout:</p>
  
  <p><img src="https://i.stack.imgur.com/0MqFU.png" alt="enter image description here"></p>
  
  <p>In my code below, what can I improve if i want to get data without null cell and name table at the begin? </p>
  
  <pre><code>public static void main(String[] args) {
          String path = "C:\\Users\\\\Desktop\\project\\x.csv";
          File file = new File(path);
  
          Connection connect = null;
          Statement s = null;
  
          try {
              BufferedReader br = new BufferedReader(new FileReader(file));
              String line;
  
              try {
                  Class.forName("org.postgresql.Driver");
                  connect =  DriverManager.getConnection("jdbc:postgresql://johnny.heliohost.org:5432/hostdb_allotments" +
                          "?user=hostdb_administrator&amp;password=");
  
                  s = connect.createStatement();
              } catch (Exception e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
              while ((line = br.readLine()) != null) {
                              try {
                                  String[] arr = line.split(",");
                  String sql = "INSERT INTO Dzialki " +
                                              "(Nr_dzialki, Powierzchnia) " + 
                                              "VALUES ('" + arr[0] + "','" + arr[1] + "') ";
                  s.execute(sql);
                              } catch (SQLException e) {
                      // TODO Auto-generated catch block
                  e.printStackTrace();
                              }
                   System.out.println("Import success!");
              }
              br.close();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }   
      }
  
  }
  </code></pre>