Contar os resgistro (tab em BD) e msotrar o total em JTextFeild ou JLabel

Boa noite!!

Como contar os registros em uma tabela dentro de uma banco em mostrar em um JTextField ou JLabel?

Eu tentei isso mas não funciona.

[code]private void formWindowActivated(java.awt.event.WindowEvent evt) {
//Metodo para mostrar total de registros
Connection conn = null;
ResultSet rs = null;
PreparedStatement pst = null;
try{

        String sSql = "select count(TIM_NOME) from TIMES";
        pst = conn.prepareStatement(sSql);
        rs = pst.executeQuery();
        if(rs.next()){
            String TtlTimes = rs.getString("count(TIM_NOME)");
            jtfTtlTimes.setText(TtlTimes);
        }
}catch(Exception e){

}
}       [/code]

Tens de dar um nome à tua coluna

String sSql = "select count(TIM_NOME) as contador from TIMES";  

(...)

    String TtlTimes = rs.getString("contador");