O'Reilly logo

Beginning Java 8 APIs, Extensions and Libraries Swing, JavaFX, JavaScript, JDBC and Network Programming APIs by Kishori Sharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving LOB Data

You can retrieve Blob, Clob and NClob column’s data from a result set using the getBlob(), getClob(), and getNClob() methods of the ResultSet interface, respectively. These methods return an object of the java.sql.Blob, java.sql.Clob, and java.sql.NClob interfaces, respectively. These interfaces include many methods that let you query the LOB object and manipulate the data they represent. The following snippet of code reads rows from the person_detail table for the person_detail_id equal to 1001:

Connection conn = JDBCUtil.getConnection();String SQL = "select person_id, picture, resume " +             "from person_detail " +             "where person_detail_id = ?";PreparedStatement pstmt = null;pstmt = conn.prepareStatement(SQL); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required