netbeans - Make Java application create SQL document file -


i understand how create program creates text file. said text file formatted sql document, can imported derby database.

this code have now:

private void jbutton3actionperformed(java.awt.event.actionevent evt) {                                              joptionpane.showmessagedialog(frame, "thank joining bpa!");     string content = "first name: " + fname.gettext() + "\r\n" +                      "middle initial: " + mname.gettext() + "\r\n" +                      "last name: " + lname.gettext() + "\r\n" +                      "email address: " + email.gettext() + "\r\n" +                       "phone number: " + phone.gettext() + "\r\n" +                      "street address: " + saddress.gettext() + "\r\n" +                       "city: " + city.gettext() + "\r\n" +                        //state                      "zip: " + zip.gettext() + "\r\n" +                       //grade                      //shop                      "home room: " + hroom.gettext() + "\r\n" +                       "parent name: " + pname.gettext() + "\r\n" +                       "parent email: " + pemail.gettext() + "\r\n" +                      "\r\n" +                       "\r\n" +                       "please send file bpasignup@gmail.com complete registration process" + "\r\n" +                       "you may delete file after it's been sent";      try {              file file = new file("g:/bat/bpasignup.sql");              // if file doesnt exists, create             if (!file.exists()) {                 file.createnewfile();             }              filewriter fw = new filewriter(file.getabsolutefile());             bufferedwriter bw = new bufferedwriter(fw);             bw.write(content);    //step2: write             bw.close();              system.out.println("done");          } catch (ioexception e) {             e.printstacktrace(); 

it creates document looks this:

first name: middle initial: last name: email address: phone number: street address: city: zip: home room: parent name: parent email:

please send file hidden complete registration process may delete file after it's been sent

i change format, information pulled correct jtextfields before. please forgive me if i'm not being clear.

insert bpasignup (fname, minitial, lname, email, phonenum, saddress, city, state, grade, shop, hroom, pname, pemail) values (' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', , ' ', ' ');

thank in advance!


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -