java - Adding textfile data to Derby Database -
i have code reading data textfile , splitting hastags. data stored in array. using derby database on netbeans, question is, data separated, how insert data derby database.
input data in text file:
569#chandini#singh#58#24#89 425#angel#dan#67#58#26 780#red#velvet#48#21#10
input data (after splitting hastags) needs inserted derby database:
569 chandini singh 58 24 89 425 angel dan 67 58 26 780 red velvet 48 21 10
this current insert code have written:
studenttbl std = new studenttbl(); std.setstudentid(short.parseshort(id.gettext())); std.setname(name.gettext()); std.setsurname(surname.gettext()); std.setit(integer.parseint(it.gettext())); std.setphysics(integer.parseint(physics.gettext())); std.setmaths(integer.parseint(math.gettext())); studydbpuentitymanager.gettransaction().begin(); studydbpuentitymanager.persist(std); studydbpuentitymanager.gettransaction().commit(); studenttbllist.clear(); studenttbllist.addall(studenttblquery.getresultlist()); iterator = studenttbllist.listiterator(0); setstudents(iterator.next()); system.out.println("inserted");
this code inserts textfields.
thanks
Comments
Post a Comment