将Office Open XML(OOXML)文件作为blob插入MySQL

Dan*_*age 5 xml mysql sql blob openxml

我有很多使用扩展XML保存的Office Open XML(OOXML)文件,我试图将这些文件插入到MySQL数据库中.我可以连接好,我已经能够使用相同的语法将字符串插入到不同的数据库中.但是当我尝试将XML文件插入数据库中的blob字段时,它告诉我我的语法有问题.由于文件的格式,我应该做些什么特别的事吗?

public Insertion(Connection conn) throws SQLException, FileNotFoundException{

    System.out.println("Trying to insert Data..");

    String filePath1 = "C:/Users/SAVAGD05/Documents/RMP/Section1.XML";
    InputStream inputStream1 = new FileInputStream(new File(filePath1));
    String filePath2 = "C:/Users/SAVAGD05/Documents/RMP/Section1.XML";
    InputStream inputStream2 = new FileInputStream(new File(filePath2));
    String filePath3 = "C:/Users/SAVAGD05/Documents/RMP/Section1.XML";
    InputStream inputStream3 = new FileInputStream(new File(filePath3));

    System.out.println("It did this part");

    String SQL = "INSERT INTO (1,2,3) values(?,?,?)";
    PreparedStatement statement = conn.prepareStatement(SQL);


    statement.setBlob(1, inputStream1);
    statement.setBlob(2, inputStream2);
    statement.setBlob(3, inputStream3);
    statement.executeUpdate();


    System.out.println("Data inserted.");
    conn.close();
    System.out.println("Connection Closed");
    System.out.println("Have a Nice Day and Goodbye.");
    }


}
Run Code Online (Sandbox Code Playgroud)

这是错误:

"线程中的异常"主"
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:您的SQL语法中有错误;请查看与您的MySQL服务器版本对应的手册,以便在'附近使用正确的语法'(1,2 ,3)值(_binary'PK\0\0\0\0\0!\ 0?RH?\ 0\0?\ 0\0\0 [Content_Types].'在第1行".

在我的控制台上,一些0作为一个问号出现在一个方框中.

Dan*_*age 3

好吧,我意识到这只是一个小语法错误。这:

String SQL = "INSERT INTO (1,2,3) values(?,?,?)";
Run Code Online (Sandbox Code Playgroud)

需要是:

 String SQL = "INSERT INTO sections(idSections,Section1,Section2,Section3) values(?,?,?,?)";
Run Code Online (Sandbox Code Playgroud)

因为我需要声明表名并为 id 字段指定一个值。

事实证明,xml 扩展中的 ooxml 数据没有问题,因为可以在 MS Word 中打开生成的查询(这就是我的目标/想要的)