Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Java and database

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 12-12-2009
Member
 
Join Date: Jun 2009
Posts: 53
Java and database
  

I'm developing a java application for my cousin who will be a psychologist. During the holidays, I was looking for subjects to learn because I'm not an expert in java, so I wanted to get ahead! My project is progressing slowly, normal, even when I started and then of course come back but not in a hurry.

I created a picture of the system, in order to arrange the person (patient). Until then I can create and initialize all in graph no problem it works. The trick of course is that once the program is closed, the table in memory is destroyed, so it will not re-open it and I thought making a "database" using a file!

For now, I use a .txt, I have my serialized class Person for the record, however, when the food that I can restore by typing the first line. Because that's the problem I have no way of knowing how many times I have to use the method "readObject ()" because at the beginning my program does not know how many people are registered in my text file!

Therefore I wonder if you have a solution, I eventually thought of using the system database, so a key like "ID" (Person 1, Person 2 ,....) where I would have an ID to each person who corresponds to its location in the table ...

You know what? How can I organize patient details in my text file?

Reply With Quote
  #2  
Old 12-12-2009
Member
 
Join Date: Apr 2008
Posts: 1,993
Re: Java and database

MySql is a free RDBMS and efficient especially for simple databases. The program runs as a server providing multi-user access to a number of databases. You can even find a lot of tutorials and faqs about the DBMS/MySQL. MySQL works on many different system platforms, including BSDi, FreeBSD, Linux, Mac OS X, NetBSD, Novell NetWare, OpenBSD, OpenSolaris, IRIX, Solaris, Symbian, SunOS, and Microsoft Windows.
Reply With Quote
  #3  
Old 12-12-2009
Member
 
Join Date: Nov 2008
Posts: 1,185
Re: Java and database

There is a database management system dedicated to Java (and written in Java). It is not an independent server, but a library that it simply adds to his project that uses readily as any implementation of JDBC. This DBMS is called HSQLDB (HyperSQL DataBase). It supports nearly full ANSI-92 SQL (BNF tree format) plus many SQL:2008 enhancements. Additionally, it includes tools such as a command line SQL tool and GUI query tools.
Reply With Quote
  #4  
Old 12-12-2009
Member
 
Join Date: Jun 2009
Posts: 53
Re: Java and database

Okay I'll see it! But I do not want an external database, I want here to stay on the pc. Clearly this should work without an internet connection, then, is that these solutions meet this criteria? And I suppose that this database will save a file to me to place, so surely at the root, but if I ever want to encrypt, what algo should I use?
Reply With Quote
  #5  
Old 12-12-2009
Member
 
Join Date: Apr 2008
Posts: 1,993
Re: Java and database

Yes the two solutions meet these criteria, you do not need an Internet connection. Why do you want to encrypt the file from database?
Reply With Quote
  #6  
Old 12-12-2009
Member
 
Join Date: Nov 2008
Posts: 1,192
Re: Java and database

Quote:
Originally Posted by DotNetUser View Post
There is a database management system dedicated to Java (and written in Java). It is not an independent server, but a library that it simply adds to his project that uses readily as any implementation of JDBC. This DBMS is called HSQLDB (HyperSQL DataBase). It supports nearly full ANSI-92 SQL (BNF tree format) plus many SQL:2008 enhancements. Additionally, it includes tools such as a command line SQL tool and GUI query tools.
The creator of HSQLDB embarked on creating a new database called H2. HSQLDB is no longer maintained it seems (to check) so if ever you incline to the solution I suggest you see H2 instead of. You just add a jar file to your project to use H2, then you do not need an Internet connection to access it. H2 is more efficient, I think it may be a good solution for your project.

H2 features:
* Very fast, open source, JDBC API
* Embedded and server modes; in-memory databases
* Browser based Console application
* Small footprint: around 1 MB jar file size
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Java and database"
Thread Thread Starter Forum Replies Last Post
Implement Simple Database using BST in Java maxmidg412 Software Development 2 31-07-2011 03:22 AM
How a Java program can be connected through database ? Chellam Software Development 4 09-12-2010 07:41 AM
Database generator for java Miles Runner Software Development 5 06-03-2010 12:56 PM
Java in oracle 9i database Gerri Software Development 4 03-02-2010 07:35 PM
Problem while database connection in java Jagriti Software Development 3 17-11-2009 10:32 AM


All times are GMT +5.5. The time now is 11:24 PM.