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);
                        resultSet = pstmt.executeQuery();
                            listSummary[0] = resultSet.getInt(1);
                            listSummary[0] = resultSet.getInt(2);

Recommended Answers

You are selecting one column but trying to read two.

Jump to Post

All 2 Replies

You are selecting one column but trying to read two.

thanx playa!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.