SavePicture.java :
public class SavePicture {
public static void main(String[] args) {
Connection conn=null;
PreparedStatement pstmt=null;
String sql="insert into student(id,name,photo) values(?,?,?)";
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
conn=DriverManager.
getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
pstmt=conn.prepareStatement(sql);
pstmt.setInt(1,1);
pstmt.setString(2,"tom");
//以下为重点部分