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. 1.JPG

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
4.JPG

Recommended Answers

All 4 Replies

thanks for those, but not in C#
but in Java. I know how to put date and those. just want to create a file by the name and import the data inside.

I'm not sure what you are trying to do?

Are you storing the data in a SQL database, or in files inside a directory???

Im storing those in SqLite
but when export to put those in files inside a directory

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.