Showing posts with label getBytes. Show all posts
Showing posts with label getBytes. Show all posts

Friday, December 9, 2011

Inserting and Retrieving images to sqlite

I tried with BinaryStream and Blob but both don't work properly.
Blob is not implemented with sqlite jdbc driver.

Note : setBytes() , getBytes() works properly with sqlite.

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sqliteimagetest;

import java.awt.Image;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
© kani.stack.notez 2012 | Blogger Template by Enny Law - Ngetik Dot Com - Nulis