Java and Databases

How to make simple application with JAVA and Databases?

Page 1 of 1

3 Replies - 883 Views - Last Post: 02 May 2010 - 05:51 AM Rate Topic: -----

#1 blues90  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 20
  • Joined: 25-June 09

Java and Databases

Posted 01 May 2010 - 07:50 AM

Hi all,

Could anyone show how to make simple application with JAVA and Databases?

For Example, a very simple application with username and password..

Please..
Is This A Good Question/Topic? 0
  • +

Replies To: Java and Databases

#2 Luckless  Icon User is offline

  • </luck>
  • member icon

Reputation: 292
  • View blog
  • Posts: 1,146
  • Joined: 31-August 09

Re: Java and Databases

Posted 01 May 2010 - 07:59 AM

Dream in Code has a policy where we would like to see a good faith effort on your part before we help you out, but I will give you a hint. Though it's not good coding practice, use two arrays--one for password and one for usernames then you can iterate through them to compare. If you wanted to go about it the more accepted way, create a class that has a variable for username and password then create an instance of it in your main method

Store user1 = new Store(username, password;)

This post has been edited by Luckless: 01 May 2010 - 07:59 AM

Was This Post Helpful? 0
  • +
  • -

#3 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2871
  • View blog
  • Posts: 11,026
  • Joined: 15-July 08

Re: Java and Databases

Posted 01 May 2010 - 08:56 PM

Yes, that works for a simple application, but it is non-persistent, meaning they won't still exist when the program restarts. You can either output them to a file or actually use a database (JDBC). For information on JDBC, look here:
http://java.sun.com/...jdbc/index.html
Was This Post Helpful? 0
  • +
  • -

#4 Luckless  Icon User is offline

  • </luck>
  • member icon

Reputation: 292
  • View blog
  • Posts: 1,146
  • Joined: 31-August 09

Re: Java and Databases

Posted 02 May 2010 - 05:51 AM

Quote

Could anyone show how to make simple application with JAVA and Databases?


Wasn't really sure what to give out, lol.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1