-1

Im getting invalid coulmn index...any suggestions?...thanx in advance

public static int[] getListSummary(UserDataVO userData) throws Exception {
        Connection connection	= null;
        PreparedStatement pstmt	= null;
        ResultSet resultSet		= null;
        int[] listSummary = {0,0};
        int leadCount = 0;
        
        try {
            connection = DataBaseConnectionManager.getConnection();
            if (connection != null) {
                    if (userData.isAgentType()) {
                        String sqlStmt = "SELECT COUNT(PK_LISTID) as TheCount  FROM OLS_LISTING t" +
                        " WHERE t.fk_agentid1 = ?  or t.fk_agentid2 = ? ";
 
//                        logger.debug(sqlStmt);
                        pstmt = connection.prepareStatement(sqlStmt);
                        pstmt.setInt(1,userData.getAgentId());
                        pstmt.setInt(2,userData.getAgentId());
                        resultSet = pstmt.executeQuery();
                         resultSet.next(); 
                            listSummary[0] = resultSet.getInt(1);
                            listSummary[0] = resultSet.getInt(2);
                        
                        resultSet.close();
                        pstmt.close();
2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by mimsc
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.