s******i 发帖数: 1 | 1 dear all :
How to insert image in a table of DB2 ?
please tall me,thank you !! | q***e 发帖数: 21 | 2
The best way for you is to go to
http://www.redbooks.ibm.com
and search all db2 materials(input db2 to search), choose
associate platform and tools you use.
If you use java, you can also go to
http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/index
.html
and read "Using SQL3 Datatypes" for more detail.
【在 s******i 的大作中提到】 : dear all : : How to insert image in a table of DB2 ? : please tall me,thank you !!
| f*******h 发帖数: 1269 | 3 An example in Java:
Suppose you have a table (id varchar, image blob)
public static void loadImage(Connection con, String fileName, String
tableName, String idValue){
File imageFile;
try{
imageFile = new File(fileName);
} catch (Exception e) {
System.out.println("File not found!");
return;
}
String queryString = "INSERT INTO "+tableName+" VALUES(?,?)";
try{
PreparedStatement pstmt = |
|