请问如何将一个字符串插入到oracle.sql.BLOB类型里面去

解决方案 »

  1.   

    可以用PreparedStatement的setBytes(int,字符串.getBytes())试试
      

  2.   

    小弟才开始用oracle能不能把原码贴出来啊
      

  3.   

    try{
        Connetion conn=DriverManager.getConnection(url,user,pwd); 
        PreparedStatement psm=conn.prepareStatement("insert into table values(?)");
        psm.setBytes(1,"字符串".getBytes());
        psm.executeUpdate();
        conn.commit();
        psm.close();
        conn.close();
    } catch(SQLException e) {
        e.printStackTrace();
    }    
    就写了一个字段,你试试吧