Announcement Announcement Module
No announcement yet.
Insert blob in Database error (SQL state [99999]; error code [17004]....) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Insert blob in Database error (SQL state [99999]; error code [17004]....)

    This is my code
    private SimpleJdbcTemplate jdbcTemplate;


    ApplicationContext ac = new ClassPathXmlApplicationContext("spring/dao-config.xml");
    final LobHandler lobHandler = (LobHandler) ac.getBean("lobHandler");
    final File blobIn = new File("C:/Temp/path.txt");
    final InputStream blobIs = new FileInputStream(blobIn);
    this.jdbcTemplate.update("INSERT INTO TEST (TEXT_F, FILE_F) values (?,?)", new AbstractLobCreatingPreparedStatementCallback(
    lobHandler) {
    protected void setValues(PreparedStatement ps,
    LobCreator lobCreator)
    throws SQLException {
    ps.setString(1, "A");
    lobCreator.setBlobAsBinaryStream(ps, 2,
    blobIs, (int) blobIn.length());
    The xml

    <bean id="lobHandler" class=" LobHandler">
    any clue?

    Thanks in advance.

  • #2
    Not much out there on this. But what I saw in my Google search, tended to lean towards invalid column type. Like you are tryng to save the blob information in a non blob field. Or the data you are sending to be stored in the blob field is not blob data.

    Sorry, I couldn't be more help.