Hello,
I am storing an image in the database. I would like to know how can I resize the image before actually saving the image.
I have a form with a label, a button and a text field to store the image path.Here is my code
public void SaveImage() {
Properties conProps = new Properties();
conProps.setProperty("user", "root");
conProps.setProperty("password", "root");
try {
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/db_1", conProps);
} catch (SQLException ex) {
Logger.getLogger(NewStudent.class.getName()).log(Level.SEVERE, null, ex);
}
String sql = ("insert image into customers value ?");
try {
st = (PreparedStatement) con.prepareStatement(sql);
st.setBytes(1, person_image);
st.execute();
} catch (Exception se) {
se.printStackTrace();
}
}
I have no idea how to proceed. Any help will be appreciated