首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

java念数据库中导入图片

2014-01-23 
java想数据库中导入图片报错You have an error in your SQL syntax check the manual that corresponds t

java想数据库中导入图片
报错You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near后面是一通乱码


Connection conn=null;
PreparedStatement ps=null;
    ResultSet rs = null;
    try{
    //建立连接
    conn=TestUtil.getConnection();
    //创建语句
    String sql="insert into table2(big1) values(?)";
    ps=(PreparedStatement) conn.prepareStatement(sql);
    File file=new File("t5 .jpg");
    BufferedInputStream in=new BufferedInputStream(new FileInputStream(file));
    
    ps.setBinaryStream(1, in,(int)file.length());
    
    int i=ps.executeUpdate();
    in.close();
    System.out.println(i);
    
    
    }finally{
    TestUtil.free(rs, ps, conn);
    }
是红色的那句话有问题吗?请问怎么解决啊?应该不是关键字的问题。

热点排行