• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to connect swings with database

 
Sanju
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi folks,
how to connect swings with database or applets with database.if any body know plz give one example with database..
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
first, you should read about JDBC:
http://java.sun.com/docs/books/tutorial/jdbc/
This is the pure Java Driver that connects your app to the database. It allows you to send SQL-Queries to the database and to retrieve objects that wrap the results.
What you do with the results is a design decision. What I can tell you from experience is: do not mix up JDBC code with Swing code. Rather build data classes you can hand around in your code. It's similar to the model-view separation in JTable and TableModel. Thus, the database can change, but you don't have to mess with your Swing classes.
regards
Chantal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!