Hi all,
Very new to Java and not sure how to do this.
Want to load my form's contents of select (AvailAccounts) to an array. Then for each element update my database. I have no idea how to accomplish this. ANY suggestions or assistance would be most appreciated.
Code so far...
import java.sql.*;
import java.util.*;
public class AccountUpdate implements java.io.Serializable {
private Vector accountUpdates = null;
private java.sql.Connection conn = null;
private static final String DBURL = "jdbcracle:thintsc:1521:tmsdb01p";
private static final String DBLogin = "tscadmin";
private static final String DBPassword = "e1cadm1n";
private static final String driverName = "oracle.jdbc.driver.OracleDriver";
for(int i=0;i<getParameter(AvailAccounts.size());i++) {
while(int j=0; j<i) {
try {
Class.forName(driverName);
conn = DriverManager.getConnection(DBURL, DBLogin, DBPassword);
PreparedStatement prepStmt = null;
prepStmt = conn.prepareStatement = "UPDATE entitlement Set incustdashind = 'n', unitid = '" & ()..."
ResultSet resultSet = prepStmt.executeQuery();
j = j +1
}
}
}
}
Very new to Java and not sure how to do this.
Want to load my form's contents of select (AvailAccounts) to an array. Then for each element update my database. I have no idea how to accomplish this. ANY suggestions or assistance would be most appreciated.
Code so far...
import java.sql.*;
import java.util.*;
public class AccountUpdate implements java.io.Serializable {
private Vector accountUpdates = null;
private java.sql.Connection conn = null;
private static final String DBURL = "jdbcracle:thintsc:1521:tmsdb01p";
private static final String DBLogin = "tscadmin";
private static final String DBPassword = "e1cadm1n";
private static final String driverName = "oracle.jdbc.driver.OracleDriver";
for(int i=0;i<getParameter(AvailAccounts.size());i++) {
while(int j=0; j<i) {
try {
Class.forName(driverName);
conn = DriverManager.getConnection(DBURL, DBLogin, DBPassword);
PreparedStatement prepStmt = null;
prepStmt = conn.prepareStatement = "UPDATE entitlement Set incustdashind = 'n', unitid = '" & ()..."
ResultSet resultSet = prepStmt.executeQuery();
j = j +1
}
}
}
}