Jump to content

Tabela


ricardoprogramador

Recommended Posts

Minha função carregar tabela


public void CarregarTabela(){
try{

String sql="SELECT IDReserva,Data_prevista_entrega,Data_Reserva,nome,designacao,IDBicicleta,valor_a_pagar,Data_prevista_Recolha" 
+ " FROM Reservas,bicicletas,categorias,clientes"
+ " ORDER BY IDReserva";


System.err.println(sql);

ResultSet rs= instrucao.executeQuery(sql);

dadosreservas.limpalistareservas();
while(rs.next()){

registoreservas novo = new registoreservas(Integer.valueOf(rs.getInt("IDReserva")),rs.getString("nome"),rs.getString("IDBicicleta"),rs.getString("Data_prevista_entrega"),rs.getDouble("Valor_a_pagar"),rs.getString("Data_Reserva"),rs.getString("Data_prevista_Recolha"),rs.getString("designacao"));
dadosreservas.adicionarNovaReserva(novo);

}
rs.close();
}
catch(SQLException sqlex){
JOptionPane.showMessageDialog(null,"Não é possivel ligar à base de dados\n"+ sqlex.getMessage());
}

}
Edited by brunoais
tags code + geshi
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.