Im using NetBeans to create a data entry software for a friend.
when I save a data, it create a folder in specified location, and the name of that folder will be different from each other
for example.
it pick the Date,Invoice Number, Subject name, and create the folder. inside that folder to export the fields of the file in a .exel or .txt
and is possible the 2 imported pics to be saved in the some file?
this is the code I use to save/import data into SqLite
try{
String sql= "INSERT INTO DataImput (Invoicenumber,Date,SubjectName,VATnumber,Service,Totalamount,Image,Image2) VALUES (?,?,?,?,?,?,?,?)";
pst=conn.prepareStatement(sql);
pst.setString(1, txt_in.getText());
pst.setString(2, txt_date.getText());
pst.setString(3, txt_sn.getText());
pst.setString(4, txt_vatnr.getText());
pst.setString(5, txt_ser.getText());
pst.setString(6, txt_ta.getText());
pst.setBytes(7, bill_image);
pst.setBytes(8, bill_image1);
pst.execute();
JOptionPane.showMessageDialog(null, "Data saved");
}catch (Exception e){
JOptionPane.showMessageDialog(null, e);
}finally{
try{
rs.close();
pst.close();
}
catch(Exception e){
}
}
Image importer
JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(null);
File f = chooser.getSelectedFile();
filename = f.getAbsolutePath();
image_path1.setText(filename);
try{
File image = new File (filename);
FileInputStream fis = new FileInputStream(filename);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
for (int readNum; (readNum=fis.read(buf))!=-1; ){
bos.write(buf,0,readNum);
}
bill_image = bos.toByteArray();
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
private ImageIcon format = null;
String filename = null;
int s=0;
byte[] bill_image = null;
So can anyone Help me? Im really in need for fast help
this is the importing data section