Advertisement
Advertisement
| 04.30.2008 at 01:34PM PDT, ID: 23366812 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 04.30.2008 at 01:37PM PDT, ID: 21474356 |
| 04.30.2008 at 01:45PM PDT, ID: 21474404 |
| 04.30.2008 at 02:10PM PDT, ID: 21474577 |
| 04.30.2008 at 02:17PM PDT, ID: 21474618 |
| 04.30.2008 at 02:37PM PDT, ID: 21474774 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: |
public TableModel resultSetToTableModel(ResultSet rs) {
try {
// The below just for searches
ResultSetMetaData metaData = rs.getMetaData();
int numberOfColumns = metaData.getColumnCount();
Vector columnNames = new Vector();
// Get the column names
for (int column = 0; column < numberOfColumns; column++) {
columnNames.addElement(metaData.getColumnLabel(column + 1));
}
// Get all rows.
Vector rows = new Vector();
while (rs.next()) {
Vector newRow = new Vector();
for (int i = 1; i <= numberOfColumns; i++) {
newRow.addElement(rs.getObject(i));
}
rows.addElement(newRow);
}
return new DefaultTableModel(rows, columnNames);
}
catch (Exception e) {
e.printStackTrace();
return null;
}
}
|
| 04.30.2008 at 04:25PM PDT, ID: 21475409 |
| 04.30.2008 at 04:29PM PDT, ID: 21475427 |
| 04.30.2008 at 04:48PM PDT, ID: 21475492 |
| 04.30.2008 at 04:57PM PDT, ID: 21475526 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: |
public class SQLRowSet {
private List _rows;
private List _columns;
private boolean _hasRows = false;
private int _columnCount = 0;
private int _rowCount = 0;
public SQLRowSet(){
}
public SQLRowSet(List rows, List columns,int columnCount,int rowCount){
this.setRows(rows);
this.setColumns(columns);
this.setColumnCount(columnCount);
this.setRowCount(rowCount);
if(_rowCount != 0){
_hasRows = true;
}
}
//SQLQuery.getSQLRowSET()
public SQLRowSet getSQLRowSet(ResultSet rs) throws DACException, {
try {
// The below just for searches
ResultSetMetaData metaData = rs.getMetaData();
int numberOfColumns = metaData.getColumnCount();
Vector columnNames = new Vector();
// Get the column names
for (int column = 0; column < numberOfColumns; column++) {
columnNames.addElement(metaData.getColumnLabel(column + 1));
}
// Get all rows.
Vector rows = new Vector();
int rowCount = 0;
while (rs.next()) {
Vector newRow = new Vector();
for (int i = 1; i <= numberOfColumns; i++) {
newRow.addElement(rs.getObject(i));
}
rows.addElement(newRow);
rowCount++;
}
return new SQLRowSet(rows,columnNames,numberOfColumns,rowCount);
}
catch (SQLException se) {
throw new DACException(NMSMnemonics.RS_EXCEPTION,se);
}
}
// DAC would call this method and return rowset
//Login
private void validateUserLoginInfo(LoginVO loginInfo) throws DACException, NMSException{
String query = "Select user_domain, user_privilege, is_active from user_profile " +
"where user_id ='"+loginInfo.getUserID()+"' and user_pwd='"
+loginInfo.getPassword()+"'";
int privilege = 0;
int domain = 0;
int is_active = 0 ;
DataAccessCommand dac = DataAccessCommand.getDataAccessCommand();
SQLRowSet rowSet = dac.executeSQL(query);
if(rowSet.hasRows()){
System.out.println("Rowset has rows" + rowSet.getRowCount());
List rows = (List) rowSet.getRows().get(0);
if(rows.isEmpty()){
System.out.println("ArrayList is Empty");
throw new NMSException("No Records for the user ID");
}
else {
List columnName = (List) rowSet.getColumns();
domain = (Integer)rows.get(columnName.indexOf("USER_DOMAIN"));
privilege = (Integer)rows.get(columnName.indexOf("USER_PRIVILEGE"));
is_active = (Integer)rows.get(columnName.indexOf("IS_ACTIVE"));
System.out.println("domain" + domain +"privilege" +privilege +"is_active" + is_active);
}
}
}
|
| 04.30.2008 at 04:59PM PDT, ID: 21475534 |
| 04.30.2008 at 05:01PM PDT, ID: 21475546 |
| 04.30.2008 at 05:07PM PDT, ID: 21475562 |
| 04.30.2008 at 05:14PM PDT, ID: 21475592 |
| 04.30.2008 at 05:31PM PDT, ID: 21475670 |
| 04.30.2008 at 05:37PM PDT, ID: 21475704 |
| 04.30.2008 at 11:28PM PDT, ID: 21476819 |
| 05.16.2008 at 11:36AM PDT, ID: 21585288 |
| 05.17.2008 at 04:11AM PDT, ID: 21588734 |
| 05.17.2008 at 06:54AM PDT, ID: 21589335 |
| 05.27.2008 at 05:05PM PDT, ID: 21656683 |
| 05.27.2008 at 05:13PM PDT, ID: 21656719 |