Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to connect swings with database  RSS feed

 
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!