import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.sql.*;
public class RefHistTest
{
public static void main(String args[])
{
int iw2, ih2;
Image img2;
int pixels2[];
double[] hist2 = new double[256];
int y;
ResultSet r;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:CBIRS");
Statement st=c.createStatement();
r=st.executeQuery("select Images from ImageTable");
byte[] bytes=null;
while(r.next())
{
//getting pixels
bytes = r.getBytes(2);
Toolkit toolkit = Toolkit.getDefaultToolkit();
img2 = toolkit.createImage(bytes);
iw2 = img2.getWidth(null);
ih2 = img2.getHeight(null);
pixels2 = new int[iw2*ih2];
PixelGrabber pg = new PixelGrabber(img2,0,0,iw2,ih2,pixels2,0,iw2);
pg.grabPixels();
//calculating hist array
for (int i=0; i<iw2*ih2; i++)
{
int p2 = pixels2[i];
int r2 = 0xff & (p2 >> 16);
int g2 = 0xff & (p2 >> 8);
int b2 = 0xff & (p2);
y = (int) (.33 * r2 + .56 * g2+ .11 * b2);
hist2[y]++;
}
for(int i=1; i<256; i++)
{
System.out.println("histogram:" + hist2[i] );
}
}
}
catch(SQLException e)
{
System.out.println("SQL error");
return;
}
catch(InterruptedException e)
{
System.out.println("interrupted");
return;
}
catch(ClassNotFoundException e)
{
System.out.println("class not found");
return;
}
}
}
i am getting SQL error: file not found
plz tell me where's the mistake