how do you display image from a access database into a jtable in java

import java.awt.*;
import java.sql.*;
import java.util.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.image.*;

public class JTableDatabase {
public static void main(String[] args) {
Vector columnNames = new Vector();
Vector data = new Vector();
JPanel p=new JPanel();
try {
Connection con = DriverManager.getConnection("jdbc:odbc:access");
String sql = "Select * from data";
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery( sql );
ResultSetMetaData md = rs.getMetaData();
int columns = md.getColumnCount();
for (int i = 1; i <= columns; i++) {
columnNames.addElement( md.getColumnName(i) );
while ( {
Vector row = new Vector(columns);
for (int i = 1; i <= columns; i++){
row.addElement( rs.getObject(i) );
data.addElement( row );
catch(Exception e){
JTable table = new JTable(data, columnNames);
TableColumn col;
for (int i = 0; i < table.getColumnCount(); i++) {
col = table.getColumnModel().getColumn(i);
JScrollPane scrollPane = new JScrollPane( table );
p.add( scrollPane );
JFrame f=new JFrame();


you write the code that does so.
if your code fails, you post it here, and say what you're stuck with.

Prabhat_1: no doubt you meant well, but there are several reasons you shouldn't just post code here.

the rules each member here agreed on ( ) requires us to (when we post a question) at least to provide some proof that we actually put in an effort for ourselves.

give the OP the chance to learn, not just to copy paste a "working" solution.
sure, this will work. but using Vector? (just a for instance).
your code is far from ideal. not only will the OP learn in a way that he literally just learns this code by heart, without truly understanding what it does, but he'll learn the flaws in the code as being "good code".

I'm sure you intended to help, but here we try to teach people the knowledge and skills they need. We don't just do their homework for them.
If you do want to post code here as an example or solution you should be careful that is is a good example, not just a load of uncommented unindented code based on an obsolete version of Java, otherwize you may find that it attracts a lot of criticism!