Habe das jetzt so gemacht.Um erlich gesagt kann ich nicht mehr klar denken.Sorry.
Code:
public static String getPicture(String key) {
ResultSet res = stmt.executeQuery("Insert into Pictrue(name,photo) " + "values(1,dj)"+ key + "'");
Blob blob = connection.createBlob();
ImageIcon ii = new ImageIcon("dj.gif");
ObjectOutputStream oos;
oos = new ObjectOutputStream(blob.setBinaryStream(1));
oos.writeObject(ii);
oos.close();
connection.setBlob(2, blob);
connection.execute();
blob.free();
connection.close();
}
Code:
---------- Javac ----------
LibraryData.java:86: cannot find symbol
symbol : method setBlob(int,java.sql.Blob)
location: interface java.sql.Connection
connection.setBlob(2, blob);
^
LibraryData.java:87: cannot find symbol
symbol : method execute()
location: interface java.sql.Connection
connection.execute();
^
2 errors
Output completed (0 sec consumed) - Normal Termination