Results 1 to 10 of 10

Thread: Java + databases

  1. #1
    Senior Member Kezzer's Avatar
    Join Date
    Sep 2003
    Posts
    4,863
    Thanks
    12
    Thanked
    5 times in 5 posts

    Java + databases

    Just a quicky. Had a look at JDBC but I need a database which can be stored locally (to hard-drive) without any other installations. It's a program which some of us will be developing but is aimed at non-technical people as well. Would a multi-dimensional array solve the problem and is it possible to save the data to a file and retrieve it later perhaps?

    Cheers

  2. #2
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    If you start with a database created and configured in whichever RDBMS then you shouldn't have any problems. You know how to embed SQL right?
    Last edited by yamangman; 22-02-2005 at 01:28 AM.
    To err is human. To really foul things up ... you need a computer.

  3. #3
    Senior Member Kezzer's Avatar
    Join Date
    Sep 2003
    Posts
    4,863
    Thanks
    12
    Thanked
    5 times in 5 posts
    Nope, i have no idea how to embed SQL. I might use ArrayList in java though

  4. #4
    Goat Boy
    Join Date
    Jul 2003
    Location
    Alexandra Park, London
    Posts
    2,428
    Thanks
    0
    Thanked
    0 times in 0 posts
    "All our beliefs are being challenged now, and rightfully so, they're stupid." - Bill Hicks

  5. #5
    Senior Member Kezzer's Avatar
    Join Date
    Sep 2003
    Posts
    4,863
    Thanks
    12
    Thanked
    5 times in 5 posts
    I'm still thinking arraylist. All we have to do is store small bits of data in an array which may get quite large. As long as we can store it somewhere then it'll be ok. Will have a look into that though, it's just it'll take a long long time to figure it out

  6. #6
    DsW
    DsW is offline
    Senior Member
    Join Date
    Aug 2003
    Location
    Glasgow
    Posts
    292
    Thanks
    0
    Thanked
    0 times in 0 posts
    If you're just wanting to store a few simple objects then a database is overkill - you may as well just use object serialization. Create the objects, write them out to disk (using ObjectOutputStream) and read them in (ObjectInputStream) when needed.

  7. #7
    Senior Member Kezzer's Avatar
    Join Date
    Sep 2003
    Posts
    4,863
    Thanks
    12
    Thanked
    5 times in 5 posts
    Quote Originally Posted by DsW
    If you're just wanting to store a few simple objects then a database is overkill - you may as well just use object serialization. Create the objects, write them out to disk (using ObjectOutputStream) and read them in (ObjectInputStream) when needed.
    That's exactly what we decided to do in the end

  8. #8
    Don't feed the trolls... tiggerai's Avatar
    Join Date
    Aug 2003
    Location
    Milk & Beans
    Posts
    9,286
    Thanks
    271
    Thanked
    480 times in 313 posts
    • tiggerai's system
      • Motherboard:
      • Gigabyte MA770T-UD3P
      • CPU:
      • AMD PhenomII 955BE
      • Memory:
      • 4Gb Corsair XMS DDR3
      • Storage:
      • Lots
      • Graphics card(s):
      • Sapphire X1950XT
      • PSU:
      • Hiper Type-R 550w
      • Case:
      • Antec lovely black thing
      • Operating System:
      • Windows 7
      • Monitor(s):
      • 2x 20" widescreen
      • Internet:
      • Pipexpants
    Have a look at db4o (db4o.com) saves everything into a little file.

  9. #9
    Senior Member Kezzer's Avatar
    Join Date
    Sep 2003
    Posts
    4,863
    Thanks
    12
    Thanked
    5 times in 5 posts
    Would be useful but we've already built a file input output system to do the same job so it's a bit late now

  10. #10
    IRN-BRU(tm)
    Join Date
    Aug 2004
    Location
    Milton Keynes
    Posts
    484
    Thanks
    8
    Thanked
    9 times in 7 posts
    I would have definatly used an ObjectOutputStream - use arrays though - ArrayLists are not fast if you are talking 10000+ objects (to do with reindexing)

    Write your own array management class that can take the object you are storing so you can avoid casting. And for the love of god use System.arraycopy() do not loop through the arrays copying the data arraycopy() is much much faster.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. For OOPL developers
    By yamangman in forum Software
    Replies: 38
    Last Post: 09-02-2005, 10:24 PM
  2. JAVA BYTEVER and FEMAD (virus type thing)
    By Kumagoro in forum Software
    Replies: 5
    Last Post: 28-12-2004, 04:56 PM
  3. Potential HUGE source of free Java games / apps
    By PriestJPN in forum Smartphones and Tablets
    Replies: 4
    Last Post: 03-11-2004, 01:59 AM
  4. Java
    By Jonny M in forum Software
    Replies: 8
    Last Post: 24-12-2003, 02:33 PM
  5. Java vs .NET
    By DaBeeeenster in forum Software
    Replies: 2
    Last Post: 11-09-2003, 02:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •