Insert array data into database using Java - java

I have problem with this code..I want to extract data from flat file and store it into database. flat file format is like this:-
DT|00000001|TMDWH|UNIFI|00380520160|MAH SIEW YIN|11 |JALAN PP 2/8|TAMAN PUTRA PRIMA|PUCHONG|SELANGOR|47100|MALAYSIA|801110-14-5498||||||VOBB||A||11|JALAN PP 2/8|||TAMAN PUTRA PRIMA
DT|00000002|TMDWH|UNIFI|00322012091|JUNITA BINTI JAMAL|6 10 KONDOMINIUM FAJARIA|JALAN PANTAI BARU|KUALA LUMPUR|KUALA LUMPUR|WILAYAH PERSEKUTUAN|59200|MALAYSIA|800129-09-5078||||||VOBB||A|||JALAN PANTAI BARU|6|KONDOMINIUM FAJARIA|KUALA LUMPUR
Code:
public void massageData(String tmp) {
String RecordType = "";
String RecordNumber = "";
String sourceSystemId = "";
String targetSystemId = "";
String TelNo = "";
String Name = "";
String Addr1 = "";
String Addr2 = "";
String Addr3 = "";
String TownCity = "";
String State = "";
String PostalCd = "";
String Country = "";
String NewICNo = "";
String OldICNo = "";
String PassportNo = "";
String BRN = "";
String Latitude = "";
String Longitude = "";
String ServiceType = "";
String IndicatorType = "";
//add
String CreateDate = "";
String Filler = "";
String CRNL = "";
String HouseNo = "";
String LotNo = "";
String StreetName = "";
String AptNo = "";
String BuildingName = "";
//add
String LowID = "";
String HighID = "";
String SectionName = "";
tmp = tmp.replace("\""," "); // remove " with blank
tmp = tmp.replace("\'","\'\'");
String[] recArray = tmp.split("\\|");
RecordType = recArray[1].trim();
RecordNumber = recArray[2].trim();
sourceSystemId = recArray[3].trim();
targetSystemId = recArray[4].trim();
TelNo = recArray[5].trim();
Name = recArray[6].trim();
Addr1 = recArray[7].trim();
Addr2 = recArray[8].trim();
Addr3 = recArray[9].trim();
TownCity = recArray[10].trim();
State = recArray[11].trim();
PostalCd = recArray[12].trim();
Country = recArray[13].trim();
NewICNo = recArray[14].trim();
OldICNo = recArray[15].trim();
PassportNo = recArray[16].trim();
BRN = recArray[17].trim();
Latitude = recArray[18].trim();
Longitude = recArray[19].trim();
ServiceType = recArray[20].trim();
IndicatorType = recArray[21].trim();
//add
CreateDate = recArray[22].trim();
Filler = recArray[23].trim();
CRNL = recArray[24].trim();
//
HouseNo = recArray[25].trim();
LotNo = recArray[26].trim();
StreetName = recArray[27].trim();
AptNo = recArray[28].trim();
BuildingName = recArray[29].trim();
//add
LowID = recArray[30].trim();
HighID = recArray[31].trim();
//
SectionName = recArray[32].trim();
Connection conn = null;
ResultSet rs = null;
PreparedStatement stmt = null;
logger.info("masuk messageData");
// get actual telephone number
String actualMSISDN = parseMSISDN(TelNo);
String [] aNo = getAreaCode(actualMSISDN).split("\\|");
String iCtr = getiCtr(actualMSISDN);
iCtr = recArray[0].trim();
String stateCode = lookupStateCode(State);
String sQuery = "insert into DATA_999 (ID,RecordType,RecordNumber,SourceSystemApplicationId,TargetApplicationId,TelNo,Name,HouseNo,StreetName,AppartmentSuite,TownCity,State,PostalCode,Country,NewIC,OldIC,PassportNo,BRN,LatitudeDecimal,LongitudeDecimal,ServiceType,IndicatorType,CreateDate,Filler,Cr_Nl,HouseNo_New,LotNo_New,StreetName_New,AptNo_New,BuildingName_New,LowIDRange,HighIDRange,SectionName) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
try {
conn = ds.getConnection();
// insert post process data to data_999 table
logger.info("start Query");
stmt = conn.prepareStatement(sQuery);
stmt.setString(0,iCtr);
stmt.setString(1,RecordType);
stmt.setString(2,RecordNumber);
stmt.setString(3,sourceSystemId);
stmt.setString(4,targetSystemId);
stmt.setString(5,TelNo);
stmt.setString(6,Name);
stmt.setString(7,Addr1);
stmt.setString(8,Addr2);
stmt.setString(9,Addr3);
stmt.setString(10,TownCity);
stmt.setString(11,State);
stmt.setString(12,PostalCd);
stmt.setString(13,Country);
stmt.setString(14,NewICNo);
stmt.setString(15,OldICNo);
stmt.setString(16,PassportNo);
stmt.setString(17,BRN);
stmt.setString(18,Latitude);
stmt.setString(19,Longitude);
stmt.setString(20,ServiceType);
stmt.setString(21,IndicatorType);
//add
stmt.setString(22,CreateDate);
stmt.setString(23,Filler);
stmt.setString(24,CRNL);
//
stmt.setString(25,HouseNo);
stmt.setString(26,LotNo);
stmt.setString(27,StreetName);
stmt.setString(28,AptNo);
stmt.setString(29,BuildingName);
//add
stmt.setString(30,LowID);
stmt.setString(31,HighID);
//
stmt.setString(32,SectionName);
//stmt = conn.prepareStatement(sQuery);
int dbStat = stmt.executeUpdate();
conn.close();
} catch (SQLException s){
logger.error(s.getMessage());
}
finally {
try {if (stmt != null) stmt.close();} catch (SQLException e) {}
try {if (conn != null) conn.close();} catch (SQLException e) {}
}
I really2 hope anyone here can help me.
Current result:
No data store into database, the code was successfully compiled!
Expected result
All the data will store into database DATA_999.

The SQL API, unlike every other java API I can think of which is zero-based, is one-based - meaning it starts counting from one. Your code is trying to set the zeroth field, which should be exploding.
As a side note, because there's hardy any special processing for each field, you could replace all that code with just a few lines by simply iterating over the fields and setting the stmt params - ie don't use variables for each field:
// fyi, the regex of this split trims automatically
String[] fields = tmp.replace("\""," ").replace("\'","\'\'").trim().split("\\s*\\|\\s*");
// Do any special field processing (most need none)
field[0] = getiCtr(parseMSISDN(field[5])); // for example - just do what you need
// Now set all the SQL params
int col = 0;
for (String field : fields) {
stmt.setString(++col, field); // Note: SQL API is 1-based (not zero-based)
}

Indexes for prepared statements are 1-based:
Change stmt.setString(0,iCtr); to stmt.setString(1,iCtr);. (And adjust the following)
And please post the exception you get. It will give us more hints what might went wrong
EDIT:
Are all fields in your table of type varchar? There are values in your lines that might be modeled as ints.

Related

How come my .setTexts are coming out blank?

I am having to connect an access database to a netbeans project and create a program that allows a user to search for a football player's name, and have their results displayed on the screen. My problem is that when I do the setTexts at the end, the labels simply turn blank. I do not receive any error messages.
I don't know whether the problem lies in the linking to the database or in parsing the parameters, or somewhere else?
Connection conn = null;
PreparedStatement pst = null;
ResultSet rst = null;
String temp = new String();
String playerID = null;
String name = null;
String surname = null;
String shirtNo = null;
String height = null;
String prefFoot = null;
String nation = null;
try
{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
conn = DriverManager.getConnection("jdbc:ucanaccess://Database4.accdb");
String sql = "SELECT * FROM Players WHERE Name = (?) and Surname = (?)";
pst = conn.prepareStatement(sql);
pst.setString(1, txtfieldFirst.getText());
pst.setString(2, txtfieldSecond.getText());
rst = pst.executeQuery();
if(rst.next())
{
int count = 0;
while(rst.next())
{
playerID = rst.getString("PlayerID");
name = rst.getString("Name");
surname = rst.getString("Surname");
shirtNo = rst.getString("ShirtNo");
height = rst.getString("Height (Metres)");
prefFoot = rst.getString ("PrefFoot");
nation = rst.getString ("Nation");
}
}
conn.close();
}
catch (Exception e)
{
System.out.println(e);
}
Connection con = null;
PreparedStatement pstt = null;
ResultSet rs = null;
String temp2 = new String();
String league = null;
String DOB = null;
String club = null;
boolean tec = false;
String goals15 = null;
String goals16 = null;
String goals17 = null;
String assists15 = null;
String assists16 = null;
String assists17 = null;
try
{
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
con = DriverManager.getConnection("jdbc:ucanaccess://Database4.accdb");
String sqll = "SELECT * FROM Stats WHERE PlayerID = (?)";
pstt = con.prepareStatement(sqll);
pstt.setString(1, playerID);
rs = pstt.executeQuery();
if(rs.next())
{
int count = 0;
while(rs.next())
{
league = rs.getString("League");
DOB = rs.getString("DOB");
club = rs.getString("Club");
goals15 = rs.getString("Goals15/16");
goals16 = rs.getString("Goals16/17");
goals17 = rs.getString("Goals17/18");
assists15 = rs.getString("Assists15/16");
assists16 = rs.getString("Assists16/17");
assists17 = rs.getString("Assists17/18");
}
}
con.close();
}
catch (Exception e)
{
System.out.println(e);
}
babyStats pps = new babyStats(league, DOB, club, goals15, goals16, goals17, assists15, assists16, assists17);
babyPlayers ps = new babyPlayers(name, surname, shirtNo, height, prefFoot, nation);
PlayerScreen p = new PlayerScreen(ps, pps); //connection to other screen
p.setVisible(true);
this.setVisible(false);
public PlayerScreen(babyPlayers obj, babyStats objj) //parsed as paramters
{
initComponents();
lblName.setText(obj.getName());
lblSurname.setText(obj.getName());
lblShirtNo.setText(obj.getShirtNo());
lblDOB.setText(objj.getDOB());
lblHeight.setText(obj.getHeight());
lblPFoot.setText(obj.getPreFoot());
lblClub.setText(objj.getClub());
lblNation.setText(obj.getNation()); //these setTexts just make the labels blank
lblGoals16.setText(objj.getGoals1516());
lblGoals17.setText(objj.getGoals1617());
lblGoals18.setText(objj.getGoals1718());
lblAssists16.setText(objj.getAssists1516());
lblAssists17.setText (objj.getAssists1617());
lblAssists18.setText (objj.getAssists1718());
}
I expect the labels to be set with the details coming from the database, but they turn blank instead. I would really appreciate any help. *Update, while debugging, I used system.out.println to print one of the names, and the result came out as null. *Update, I fixed it, the while loops were not meant to be there.

Overcome java heap space error when trying to retrieve data from a large table and insert into another table?

I have a table called "snomed_conceptdata" from which iam trying to retrieve a column called "id" which has around 454772 rows present in it.And iam using this 'id' to get only certain rows from another table called snomed_descriptiondata where the conceptid column value equals this "id" and then inserting those rows to a another table called snomedinfo_data.
My current code:
package Snomed.Snomed;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Date;
import catalog.Root;
public class Snomedinfo {
public void snomedinfoinsert()
{
Root oRoot = null;
ResultSet oRsSelect = null;
PreparedStatement oPrStmt = null;
PreparedStatement oPrStmt2 = null;
PreparedStatement oPrStmtSelect = null;
String strSql = null;
String strSql2 = null;
String snomedcode=null;
ResultSet oRs = null;
String refid = null;
String id = null;
String effectivetime = null;
String active = null;
String moduleid = null;
String conceptid = null;
String languagecode = null;
String typeid = null;
String term = null;
String caseSignificanceid = null;
int count = 0;
final int batchSize = 1000;
try{
oRoot = Root.createDbConnection(null);
strSql = "SELECT id FROM snomed_conceptdata WHERE active=1 ";
oPrStmt2 = oRoot.con.prepareStatement(strSql);
oRsSelect = oPrStmt2.executeQuery();
while (oRsSelect.next()) {
snomedcode = Root.TrimString(oRsSelect.getString("id"));
String sql = "INSERT INTO snomedinfo_data (refid,id,effectivetime,active,moduleid,conceptid,languagecode,typeid,term,caseSignificanceid)SELECT refid,id,effectivetime,active,moduleid,conceptid,languagecode,typeid,term,caseSignificanceid from snomed_descriptiondata WHERE conceptid =? AND active=1" ;
oPrStmtSelect = oRoot.con.prepareStatement(sql);
oPrStmtSelect.setString(1,snomedcode);
oPrStmtSelect.executeUpdate();
}
//oPrStmtSelect.executeBatch();
System.out.println("done");
}
catch (Exception e) {
e.printStackTrace();
}
finally {
oRsSelect = Root.EcwCloseResultSet(oRsSelect);
oRs = Root.EcwCloseResultSet(oRs);
oPrStmt = Root.EcwClosePreparedStatement(oPrStmt);
oPrStmt = Root.EcwClosePreparedStatement(oPrStmt2);
oPrStmt = Root.EcwClosePreparedStatement(oPrStmtSelect);
oRoot = Root.closeDbConnection(null, oRoot);
}
}
public static void main(String args[] ) throws Exception
{
Snomedinfo a = new Snomedinfo();
a .snomedinfoinsert();
}
}
everything is working fine ie ,currently data(records) are getting inserted into the table 'snomedinfo_data' but after some time during insertion i suddenly get a java out of memory heap space error. please help!!

Java if-statement

public void searchKlijenta(KlijentiFormEvent klijentiFormEvent) throws SQLException {
String nazivK = klijentiFormEvent.getNaziv();
String adresaK = klijentiFormEvent.getAdresa();
String gradK = klijentiFormEvent.getGrad();
String drzavaK = klijentiFormEvent.getDrzava();
String telefonK = klijentiFormEvent.getTelefon();
String faxK = klijentiFormEvent.getFax();
String mailK = klijentiFormEvent.getMail();
String mobitelK = klijentiFormEvent.getMobitel();
String oibK = klijentiFormEvent.getOib();
String ugovorK = klijentiFormEvent.getUgovor();
String osobaK = klijentiFormEvent.getOsoba();
if (nazivK.length() == 0)
nazivK = null;
if (adresaK.length() == 0)
adresaK = null;
if (gradK.length() == 0)
gradK = null;
if (drzavaK.length() == 0)
drzavaK = null;
if (telefonK.length() == 0)
telefonK = null;
if (faxK.length() == 0)
faxK = null;
if (mailK.length() == 0)
mailK = null;
if (mobitelK.length() == 0)
mobitelK = null;
if (oibK.length() == 0)
oibK = null;
if (ugovorK.length() == 0)
ugovorK = null;
if (osobaK.length() == 0)
osobaK = null;
klijentiSearchModel.clear();
String sql = "select * from zavrsni.klijenti where naziv like '"+nazivK+"' or adresa like '"+adresaK+"' or grad like '"+gradK+"' or drzava like '"+drzavaK+"' or telefon like '"+telefonK+"' or fax like '"+faxK+"' or mail like '"+mailK+"' or mobitel like '"+mobitelK+"' or oib like '"+oibK+"' or ugovor like '"+ugovorK+"' or osoba like '"+osobaK+"' ";
Statement selectStmt = con.createStatement();
ResultSet result = selectStmt.executeQuery(sql);
while(result.next()) {
int id = result.getInt("id");
String naziv = result.getString("naziv");
String adresa = result.getString("adresa");
String grad = result.getString("grad");
int posBr = result.getInt("posBr");
String drzava = result.getString("drzava");
String telefon = result.getString("telefon");
String fax = result.getString("fax");
String mail = result.getString("mail");
String mobitel = result.getString("mobitel");
String oib = result.getString("oib");
String ugovor = result.getString("ugovor");
String osoba = result.getString("osoba");
KlijentiModelSearch klijentSearch = new KlijentiModelSearch(id, naziv, adresa, grad, posBr, drzava, telefon, fax, mail, mobitel, oib, ugovor, osoba);
klijentiSearchModel.add(klijentSearch);
}
result.close();
selectStmt.close();
}
Can i write this code shorter? I think of "if" statement?
Perhaps through a while loop?
Method that is use for search some client in database. This method work fane but this if-statement i want write shorter.
Thanks
EDIT SOLVED:
public void traziKlijenta(KlijentiFormEvent klijentiFormEvent) throws SQLException {
String nazivK = returnNullIfEmptys(klijentiFormEvent.getNaziv());
String adresaK = returnNullIfEmptys(klijentiFormEvent.getAdresa());
String gradK = returnNullIfEmptys(klijentiFormEvent.getGrad());
String drzavaK = returnNullIfEmptys(klijentiFormEvent.getDrzava());
String telefonK = returnNullIfEmptys(klijentiFormEvent.getTelefon());
String faxK = returnNullIfEmptys(klijentiFormEvent.getFax());
String mailK = returnNullIfEmptys(klijentiFormEvent.getMail());
String mobitelK = returnNullIfEmptys(klijentiFormEvent.getMobitel());
String oibK = returnNullIfEmptys(klijentiFormEvent.getOib());
String ugovorK = returnNullIfEmptys(klijentiFormEvent.getUgovor());
String osobaK = returnNullIfEmptys(klijentiFormEvent.getOsoba());
klijentiSearchModel.clear();
String sql = "select * from zavrsni.klijenti where naziv like '%"+nazivK+"%' or adresa like '%"+adresaK+"%' or grad like '%"+gradK+"%' or drzava like '%"+drzavaK+"%' or telefon like '%"+telefonK+"%' or fax like '%"+faxK+"%' or mail like '%"+mailK+"%' or mobitel like '%"+mobitelK+"%' or oib like '%"+oibK+"%' or ugovor like '%"+ugovorK+"%' or osoba like '%"+osobaK+"%' ";
Statement selectStmt = con.createStatement();
ResultSet result = selectStmt.executeQuery(sql);
while(result.next()) {
int id = result.getInt("id");
String naziv = result.getString("naziv");
String adresa = result.getString("adresa");
String grad = result.getString("grad");
int posBr = result.getInt("posBr");
String drzava = result.getString("drzava");
String telefon = result.getString("telefon");
String fax = result.getString("fax");
String mail = result.getString("mail");
String mobitel = result.getString("mobitel");
String oib = result.getString("oib");
String ugovor = result.getString("ugovor");
String osoba = result.getString("osoba");
KlijentiModelSearch klijentSearch = new KlijentiModelSearch(id, naziv, adresa, grad, posBr, drzava, telefon, fax, mail, mobitel, oib, ugovor, osoba);
klijentiSearchModel.add(klijentSearch);
}
result.close();
selectStmt.close();
}
private String returnNullIfEmptys(String value) {
if (value == null || value.length() == 0) {
return null;
}
return value;
}
With your actual code, #khelwood proposition in your comment question is the best approach.
Other solutions have overhead and change your design without bringing a added value .
public static String returnNullIfEmpty(String value){
if (value == null || value.length() == 0){
return null;
}
return value;
}
Then you can call it in this way :
nazivK = returnNullIfEmpty(nazivK);
adresaK= returnNullIfEmpty(adresaK);
EDIT
With the edit of your question, you could include processing as the time where you retrieve the value from the klijentiFormEvent object :
String nazivK = returnNullIfEmpty(klijentiFormEvent.getNaziv());
String adresaK = returnNullIfEmpty(klijentiFormEvent.getAdresa());
...
You simply have to put your arrays/lists ... whatever those things are ... into another array or list.
Then you iterate that array/list.
Done.
And hint: your naming could be improved dramatically. Your names should indicate what the "thing" behind the variable actually is.
Also you can use Map<String, List<?>> to store your lists/arrays/strings. for example with List:
Map<String, List<?>> map = new HashMap<>();
map.put("nazivK", new ArrayList<>());
map.put("adresaK", new ArrayList<>());
//.....
//replace all lists with null
map.replaceAll((s, list) -> list.isEmpty() ? null : list);
//or just remove it
for(Iterator<Map.Entry<String, List<?>>> it = map.entrySet().iterator(); it.hasNext(); ) {
Map.Entry<String, List<?>> entry = it.next();
if(entry.getValue().isEmpty()) {
it.remove();
}
}
As it was suggested by GhostCat, put your values into array/list.
You can do for example something like this (I suppose those values are Strings):
/* Order in array nazivK, adresaK, gradK, drzavaK, telefonK,
faxK, mailK, mobitelK, oibK, ugovorK, osobaK */
String values[] = new String[11];
for (String val: values) {
if (val == null || val.length() == 0) {
val = null;
}
}

java.lang.ArrayIndexOutOfBoundsException how to handle-7

java.lang.ArrayIndexOutOfBoundsException
how to remove this exception
public static void main(String[] args) throws ClassNotFoundException, SQLException {
FileUpdate obj = new FileUpdate();
obj.run();
}
public void run() throws SQLException, ClassNotFoundException {
String csvFile = "/home/IMRAN/file.csv";
BufferedReader br = null;
String line = "";
String cvsSplitBy = ",";
try {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date dateobj = new Date();
String dt = df.format(dateobj);
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/Rforms", "root", "root12");
Statement st = con.createStatement();
br = new BufferedReader(new FileReader(csvFile));
while ((line = br.readLine()) != null) {
String[] emp = line.split(cvsSplitBy);
// if (emp[0] != null && emp[1] != null ) {
// for(int x = 0; x < emp.length; x++) {
String t = (String) emp[0].trim();
String t2 = (String) emp[1].trim();
}
}
Problem is not clear... java.lang.ArrayIndexOutOfBoundsException occours when you try to access to an object (array element) that does not exist. For example, your array is 7 elements long and you try to access element[8]
Are you sure emp[0] is not null?
You should check length of the emp array before accessing its elements.
if(emp!=null && emp.length==2){
String t = (String) emp[0].trim();
String t2 = (String) emp[1].trim();
}
This code below tells that emp should always have 2 or more elements.
else you got java.lang.ArrayIndexOutOfBoundsException.
...
String t = (String) emp[0].trim();
String t2 = (String) emp[1].trim();
...
Hi Let's assume that you have place CSV file and content correctly in that case you can place conditions check per below
String[] emp = line.split(cvsSplitBy);
if (emp.length > N) {
String t = (String) emp[0] !=null ?emp[0].trim():"";
String t2 = (String)emp[1] !=null ?emp[1].trim():"";
}
Note that you are aware of number values fetch from the line .
or you can utilize List. this will completely take you out from this issue.
List lst= Arrays.asList(emp);
Refer java docs for how to utilize List and fetch list from it.

Populating text fields from a filtered JTable

I am currently using these two methods to set certain text fields equal to the row currently selected in the JTable. I run into a problem though when I filter that table. When the data is filtered, the text fields are not populated with the correct data. The fields are being populated with the row data that would be in that place if there was no filter on the table. Anyone have any suggestions or another way I can bind the table fields with the text fields?
private void tblEmployeeMouseClicked(java.awt.event.MouseEvent evt) {
try {
int row = tblEmployee.getSelectedRow();
String Table_click = (tblEmployee.getModel().getValueAt(row, 0).toString());
String sql = "select * from Employee where EmployeeID = " + Table_click + " ";
newDatabase.populateEmployee(sql);
}
catch(Exception e) {
JOptionPane.showMessageDialog(null, e);
e.printStackTrace();
}
}
public void populateEmployee(String sql) throws Exception{
Constructor("newDatabase");
pst = connection.prepareStatement(sql);
ResultSet rs = pst.executeQuery();
if(rs.next()) {
String add1 = rs.getString(1);
NewJFrame.txtEmpID.setText(add1);
String add2 = rs.getString(2);
NewJFrame.txtEmpFN.setText(add2);
String add3 = rs.getString(3);
NewJFrame.txtEmpLN.setText(add3);
String add4 = rs.getString(4);
NewJFrame.txtEmpMI.setText(add4);
String add5 = rs.getString(5);
NewJFrame.txtEmpAddress.setText(add5);
String add6 = rs.getString(6);
NewJFrame.txtEmpState.setText(add6);
String add7 = rs.getString(7);
NewJFrame.txtEmpZIP.setText(add7);
String add8 = rs.getString(8);
NewJFrame.txtEmpDOB.setText(add8);
String add9 = rs.getString(9);
NewJFrame.txtEmpHire.setText(add9);
String add10 = rs.getString(10);
NewJFrame.txtEmpTerm.setText(add10);
String add11 = rs.getString(11);
NewJFrame.txtEmpLic.setText(add11);
String add12 = rs.getString(12);
NewJFrame.txtEmpActive.setText(add12);
String add13 = rs.getString(13);
NewJFrame.txtEmpMan.setText(add13);
String add14 = rs.getString(14);
NewJFrame.txtEmpMod.setText(add14);
}
connection.close();
}

Categories