[color=darkblue]Estou tentando dar um select em uma jtable mais esta dando erro não consulta nada se poder dar uma olhada pois não encontro o erro
[/color]
public void Tabela(){
String driver="oracle.jdbc.driver.OracleDriver";
String url="jdbc:oracle:thin:@127.0.0.1:1521:XE";
String usuario= "usuario";
String senha=" senha";
Connection conexao;
Statement statement = null;
ResultSet resultset = null;
String seleciona = "Select id_usuario, nome, documento FROM usuario order by id_usuario";
try{
conexao = DriverManager.getConnection(url,usuario,senha);
statement = (Statement) conexao.createStatement();
resultset = statement.executeQuery(teste);
while(resultset.next()){
String id_usuario = resultset.getString("id_usuario");
String nome = resultset.getString("nome");
String documento = resultset.getString("documento");
javax.swing.table.DefaultTableModel model;
int linhas = this.tabelaUsuario.getRowCount();
tabelaUsuario.removeAll();
model=(javax.swing.table.DefaultTableModel)tabelaUsuario.getModel();
model.addRow(new Object[]{id_usuario,nome,documento});
}
}catch(SQLException e){
System.out.println("Erro o listar usuario:"+e.getMessage());
}finally{
}
}