Results 1 to 2 of 2

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

  1. #1
    Join Date
    Jan 2012
    Posts
    1

    Exclamation 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());
    }
    });
    blobIs.close();
    The xml

    [......]
    <bean id="lobHandler" class="org.springframework.jdbc.support.lob.Oracle LobHandler">
    </bean>
    [......]
    any clue?

    Thanks in advance.

  2. #2
    Join Date
    Jan 2009
    Location
    Huntington Beach, CA
    Posts
    718

    Default

    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.

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •