Retrieve data from Tables...
Hi again,
Now, I'm facing a slight problem. I wish that anyone can help me please... I created tables, and now I'm trying to fill inside it within the code. But for a reason it is not going into the method initTables at all... it only display 2 names out of 15????
This is an initiation of two tables....
try {
Statement stmt = conn.createStatement();
for (int i = 0; i < SQLData.length; i++) {
iRowCount = iRowCount+1;
iRowCount= stmt.executeUpdate("INSERT INTO authors VALUES " + SQLData[i] );
}
System.out.println( iRowCount +" Rows are inserted.");
PreparedStatement pstmtPublishers = conn.prepareStatement("INSERT INTO publishers(publisherID,publisherName) VALUES (?,?)");
for(int i=1; i <= 15; i++) {
pstmtPublishers.setInt(1, i);
pstmtPublishers.setString(2, "Publisher" + Integer.toString(i));
pstmtPublishers.executeUpdate();
}
pstmtPublishers.close();
I appreciate any help ....