Resultset

ae galera está dando esse erro quando eu executo “rst = C.Stm.executeQuery(SQL);”

java.lang.NullPointerException
at flog.RetUsua(flog.java:146)
at flog$2.keyTyped(flog.java:80)
at java.awt.Component.processKeyEvent(Unknown Source)
at javax.swing.JComponent.processKeyEvent(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.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(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.pumpOneEventForHierarchy(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)

seu alguem puder da uma força ai…

valew!!!

Bom, pelo menos postou o erro.

Deve estar vindo do BD um campo nulo, e na sua classe flog, na linha 146 você deve estar comparando esse valor nulo com alguma coisa, por isso está dando NPE.

Se não for isso posta o SQL e a classe java aonde está ocorrendo o erro!

P.S.: Utilize as tags [ code ] e [ /code ] quando for postar algum código

ai ta a classe q esta dando erro!
é uma tela de login bem simples!

Tem algumas coisas erradas:

	if (rst.getString("AG01NOME")==""){ 
			return false;	
			}

o correto:

	if (rst.getString("AG01NOME").equals("")){ 
			return false;	
			}

melhor ainda!:

/*
* sendo que esta evita null pointers =D
*/
	if ( "".equals(rst.getString("AG01NOME")) ){  
			return false;	
			}

essa linha aqui tambem esta baleada!:

 rst = C.Stm.executeQuery(SQL);

“Stm” não existe e vai dar null pointer mesmo… vc precisa ter um statement

exemplo:

Connection conn = DriverManager.getConnection("jdbc:banco...");
 
PreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?");