Nullpointer em JTable

Pessoal, estou obtendo um NullPointerException em meu programa ao tentar criar um JTable após clicar no botão “Buscar”…
segue a parte do código em que dá erro:

aux = JOptionPane.showInputDialog(null, "Insira o nome do paciente:");
try {
	Class.forName(STR_DRIVER);
	conn = DriverManager.getConnection(STR_CON,USER,PASSWORD);
	stm = conn.createStatement();
	String query3 = "SELECT * FROM pacientes WHERE nome like '%" + aux + "%'";
	rs = stm.executeQuery(query3);
	for(aux2=0; rs.next(); aux2++){
		ids[aux2] = Integer.toString(rs.getInt("ID"));
		pacientes[aux2] = rs.getString("NOME");
		lista.setValueAt(ids[aux2], aux2, 0);
		lista.setValueAt(pacientes[aux2], aux2, 1);				
	}				
} catch (Exception e1) {
	e1.printStackTrace();
	JOptionPane.showMessageDialog(null,"Erro ao se conectar com o banco de dados.");
}

Alguém sabe o motivo do erro?

Obrigado.

manda o StackTrace pra fikar mais facil…

java.lang.NullPointerException
	at br.com.psicoviver.CadastroMenu$13.mouseReleased(CadastroMenu.java:949)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

linha 949 = ids[aux2] = Integer.toString(rs.getInt(“ID”));

Em debug verifique o estado de seu “rs” e “ids”… acho que pode ser um desses dois que está null.

E outra… não é o erro acredito eu, mas utilize assim

String.valueOf(seuNumeroInteiro)

Testa aí e me fala…

Eu pensei a mesma coisa, mas fiz o teste, e o “rs” não está null…

Não tenho idéia do erro…

obs: se eu coloco os dados do resultset em um textfield, por exemplo, ele imprime normalmente…
o problema está em passar esses dados para a tabela…

EDIT: consegui já, mas refiz o código de uma maneira totalmente diferente.
valeu pela ajuda…

Teste assim e veja qual das linhas vai dar o erro:
Tire esse trecho

ids[aux2] = Integer.toString(rs.getInt("ID")); 

e add este. Vai fazer a mesma coisa porém veremos qual linha irá dar o erro

int intCod = rs.getInt("ID");
String strCod = String.valueOf(intCod);
ids[aux2] = strCod;

Me fala aí o que ocorreu…