Bonjour,
je suis un debutant en postgres java mon probleme comment ouvrir une image stockée dans une table donné
j'ai pu la stocker voila comment je l'ai stocké :
JFileChooser fc=new JFileChooser();
int y=fc.showSaveDialog(jButton);
File gg=fc.getSelectedFile();
File image =new File(gg.getAbsoluteFile().toString());
try {
connection ddd=new connection();ddd.connectio();
FileInputStream fis=new FileInputStream(image);
PreparedStatement ps = ddd.db.prepareStatement("insert into image (image,id_m) values (?,?)");
try
{
ps.setString(2,"vv");
ps.setBinaryStream(1,fis,(int)image.length());
ps.executeUpdate();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
finally
{
try {
ps.close();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
aidez moi SVP et merci d'avance
Configuration: Windows XP
Firefox 2.0.0.20