wood burning stoves 2.0*
The moose likes JDBC and the fly likes Using BLOB in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Using BLOB in java" Watch "Using BLOB in java" New topic

Using BLOB in java

Raj Khanna

Joined: Sep 13, 2007
Posts: 2
I have a class Emp

public class Emp implements java.io.Serializable {
public int no;
public String name;
public Emp(int no, String name) {
this.no = no;
this.name = name;

and i have a created a table

create table tableEmployee(empid smallint, empdata BLOB(4096))

How can add record into the blob column and also how to read data from the blob

column using java.

Would be grateful if some one can give a sample code.

Thanks in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60782

"cdude dudec", please check your private messages for an important message from me.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jQuery in Action, 2nd edition
subject: Using BLOB in java
Similar Threads
delete option of cascade in Hibernate one-to-one association
hibernate Converting byte[] into SQL Blob
sorting table columns
Secondary table
Displaying an Oracle BLOB image.