zhenghao111
7/22/2012 - 9:59 AM

Java:mysql存图片

Java:mysql存图片

    	/*存图片*/
		InputStream in=new FileInputStream("E:/1.jpg");
		PreparedStatement statement = connection.prepareStatement("INSERT INTO imag VALUES(?)");
		statement.setBinaryStream(1, in,in.available());
		statement.executeUpdate();