title: How insert json file in multiple tables using java?
body: <p>I am a beginner with json formatting and I will appreciate any help.
  I have a JSON file containing 10.000 tweets from a Twitter db.</p>
  
  <p>I create empty 5 table in a DB, each one of them has specific information like user info, tweet info, etc.  I want to insert this data from the JSON file to specific columns in any table using Java so I can do searches to retrieve specific tweets based on conditions.</p>
  
  <p>I have code to connect the database with the Java class and read the external file but it inserts it in one column, how can i divide it up?</p>
  
  <hr>
  
  <pre><code>import java.io.File;
  import java.io.FileInputStream;
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  
  public class InsertTextFileToMySQL {
  
    public static Connection getConnection() throws Exception {
      String driver = "com.mysql.jdbc.Driver";
      String url = "jdbc:mysql://localhost:8889/db_Twitter";
      String username = "root";
      String password = "root";
  
      Class.forName(driver);
      Connection conn = DriverManager.getConnection(url, username, password);
      return conn;
    }
  
    public static void main(String[] args)throws Exception {
      String id = "001";
      String fileName = "fileName.txt";
      FileInputStream fis = null;
      PreparedStatement pstmt = null;
      Connection conn = null;
      try {
        conn = getConnection();
        conn.setAutoCommit(false);
        File file = new File(fileName);
        fis = new FileInputStream(file);
        pstmt = conn.prepareStatement("insert into DataFiles(id, fileName, fileBody) values (?, ?, ?)");
        pstmt.setString(1, id);
        pstmt.setString(2, fileName);
        pstmt.setAsciiStream(3, fis, (int) file.length());
        pstmt.executeUpdate();
        conn.commit();
      } catch (Exception e) {
        System.err.println("Error: " + e.getMessage());
        e.printStackTrace();
      } finally {
        pstmt.close();
        fis.close();
        conn.close();
      }
    }
  }
  </code></pre>
  
  <p>Again, this code is inserting the entire file in one column.</p>