Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2006

Tip: Looking for answers? Try searching our database.

Writing a Movie Database?

Thread view: 
Johs - 17 Dec 2006 20:32 GMT
I would like to write a simple movie Database in java. When run it
should open a gui where all the movies are listed with the following info:

title, DVD-Number, Genre

It should be possible to add more columns later on. It should also be
possible to sort by genre and, title etc and print all the info to a pdf
file.

I hope its not necessary to use MySQL since its rather simple to just
keep all the movie info in a plain text file.

Any hints do some tutorials on this and classes that I should look into?
Andrew Thompson - 17 Dec 2006 21:12 GMT
> I would like to write a simple movie Database in java. When run it
> should open a gui where all the movies are listed with the following info:
[quoted text clipped - 4 lines]
> possible to sort by genre and, title etc and print all the info to a pdf
> file.

Why PDF?  Do you want to print it?

> I hope its not necessary to use MySQL since its rather simple to just
> keep all the movie info in a plain text file.

It sounds as though a proper DB would be overkill,
for such a simple list of titles and details.

> Any hints do some tutorials on this and classes that I should look into?

This simple DB covers a lot of diverse areas
which are largely unrelated.
- GUI Development. <http://java.sun.com/docs/books/tutorial/uiswing/>
- I/O <http://java.sun.com/docs/books/tutorial/essential/io/>
- depending on a number of different paths you can take for
the file format, one of which is storing the records as CSV -
data parsing (not sure of a good tutorial on that), or serialisation,
except that you want the option to add fields later..
- Translating to PDF format (there are some tools for that,
but you'd have to Google them).

Until you further pin down whether a DB is required,
there are really too many paths to take, to go into
'links' at this stage - perhaps if you flesh out the idea
based on the above, and a bit of googling - we can
provide further pointers.

Andrew T.
Richard Wheeldon - 17 Dec 2006 22:16 GMT
> I would like to write a simple movie Database in java. When run it
> should open a gui where all the movies are listed with the following info:

This sounds like a homework assignment. Assuming it isn't you might
want to take a look here:
    http://www.imdb.com/interfaces

At least try not to reinvent all of the wheel,

Regards,

Richard
Jeff - 18 Dec 2006 11:26 GMT
> I would like to write a simple movie Database in java. When run it
> should open a gui where all the movies are listed with the following info:
[quoted text clipped - 9 lines]
>
> Any hints do some tutorials on this and classes that I should look into?

This is pretty clearly a database project, so I would recommend you use
a database. A little prep at the beginning and you will have a much
more flexible system. Design your DB in MySQL, with columns for the
DVD#, Genre, Title, and maybe Star and SecondStar, or whatever. Then,
look into JasperReports. Free (except for the documentation), and it
can create PDFs as well as regular reports. Create a few reports in
Jasper and your actual Java front end should be quite simple to create
and maintain.
Larry Barowski - 18 Dec 2006 13:59 GMT
>I would like to write a simple movie Database in java. When run it should
>open a gui where all the movies are listed with the following info:
[quoted text clipped - 7 lines]
> I hope its not necessary to use MySQL since its rather simple to just keep
> all the movie info in a plain text file.

If you had every movie in IMDB, that would be less than
70,000. Even with that number you could easily keep the
data in a flat file, and while running keep all data in memory
sorted and/or hashed by title, number, and genre. I do a
similar thing with a few hundred thousand download records,
and the performance is quite good.
David Segall - 18 Dec 2006 15:16 GMT
>>I would like to write a simple movie Database in java. When run it should
>>open a gui where all the movies are listed with the following info:
[quoted text clipped - 14 lines]
>similar thing with a few hundred thousand download records,
>and the performance is quite good.
Apart from a few read-only applications like the main dictionary of a
spell checker what advantage is there in not using a database?
Larry Barowski - 19 Dec 2006 13:33 GMT
> Apart from a few read-only applications like the main dictionary of a
> spell checker what advantage is there in not using a database?

Performance, simplicity, no need for database software.
In the OPs case, assuming it is a single-user app, what
advantage would using a database bring?  If it does
become advantageous at a later date (many new fields
and complex queries, or something), which seems unlikely,
the data can easily be loaded into a standard database.
David Segall - 19 Dec 2006 16:10 GMT
>> Apart from a few read-only applications like the main dictionary of a
>> spell checker what advantage is there in not using a database?
>
>Performance,
It is unlikely that one programmer can write code that outperforms the
code written by teams of open source programmers or those from IBM,
Oracle or Microsoft. Their code has been subjected to competitive
benchmark timing tests over many years.
>simplicity,
How can from tens to hundreds of lines of Java be simpler than one SQL
statement and, at most, five template lines of Java to execute it?
>no need for database software.
The database software consists of a couple jar files that must be
included with the application. Derby requires about 2MB which would
only be a problem if you were writing software for a microwave oven.
>In the OPs case, assuming it is a single-user app, what
>advantage would using a database bring?
I have answered that question in a separate post in this thread.
>  If it does
>become advantageous at a later date (many new fields
>and complex queries, or something), which seems unlikely,
>the data can easily be loaded into a standard database.
True, but the OP would have wasted considerable time in writing and
maintaining code that he is now throwing away.
Larry Barowski - 20 Dec 2006 15:45 GMT
> It is unlikely that one programmer can write code that outperforms the
> code written by teams of open source programmers or those from IBM,
> Oracle or Microsoft. Their code has been subjected to competitive
> benchmark timing tests over many years.

I don't get your argument here. General purpose database software is
competitive in the sense that it is compared to other general purpose
database software. Not using such software may be orders of magnitude
faster than using it, depending on the purpose.

> How can from tens to hundreds of lines of Java be simpler than one SQL
> statement and, at most, five template lines of Java to execute it?

It would be simpler in the project sense rather than the lines-of-code
sense.

> The database software consists of a couple jar files that must be
> included with the application. Derby requires about 2MB which would
> only be a problem if you were writing software for a microwave oven.

Those jar files are fairly large though. I work on a medium-sized
(250 KLOC) project which is about a 3 meg download. Adding the
necessary jar files from Derby would slightly more than double the
download size and load on our servers. We have lots of data that is
accessed by single keys only, which is stored in a custom
flat-files+index-files database. For efficiency, the data is organized
and accesses are cached in a very domain-specific way. Using
standard database software would be several times slower at best,
and the difference in speed would be noticeable to users.
David Segall - 21 Dec 2006 13:53 GMT
>> It is unlikely that one programmer can write code that outperforms the
>> code written by teams of open source programmers or those from IBM,
[quoted text clipped - 25 lines]
>standard database software would be several times slower at best,
>and the difference in speed would be noticeable to users.

I thought I covered your application in my response to your first post
which was "Apart from a few read-only applications like the main
dictionary of a spell checker what advantage is there in not using a
database?" I cannot question your analysis of your own application.
However, I think that your advice to the OP who has a standard CRUD
application is wrong. There are probably applications that should use
their own implementation of java.text but, for the rest of us, a
library of optimised, pre-tested code that we don't need to write or
maintain is far superior.
David Segall - 18 Dec 2006 14:24 GMT
>I would like to write a simple movie Database in java. When run it
>should open a gui where all the movies are listed with the following info:
[quoted text clipped - 3 lines]
>It should be possible to add more columns later on. It should also be
>possible to sort by genre and, title etc
Use a database. You already have two tables because you will want
another one to prevent an incorrect Genre being used. In addition it
provides tested, optimised code to do all the above.

>and print all the info to a pdf file.

>I hope its not necessary to use MySQL
It does not need to be a client-server database. An embedded database
requires two jar files to be added to your application. See
<http://database.profectus.com.au/#java> for an incomplete list.

As an aside, it is never necessary to use MySQL for anything and I
don't understand why anybody does. My reasons are given on the page
referenced above.
>since its rather simple to just
>keep all the movie info in a plain text file.
A database is even simpler. You can use Open Office Base
<http://www.openoffice.org/product/base.html> to examine and change
your data, add new columns, produce PDF reports and do everything else
you have specified. I am assuming you are using this as an exercise to
learn Java. If you just want the application, Open Office Base
includes a wizard that sets up a DVD collection database.
Daniel - 21 Dec 2006 09:40 GMT
>I would like to write a simple movie Database in java. When run it
>should open a gui where all the movies are listed with the following info:
[quoted text clipped - 9 lines]
>
>Any hints do some tutorials on this and classes that I should look into?

Depending on the reason for you doing this I would consider the
following.
If your reasons are purly as an excersice to get better at java, I
would probably consider using a db, as that would involve using jdbc
and working with resultsets.
Of course the same goes for using plain textfiles as that would force
you to dig a bit into parsing textfiles, and also the design of the
textfiles.
Either way you are in for a fun and interesting project. If I were you
I would go for the jdbc as that will probably prove to be good
knowledge for you in the future.

If your reason for writing this is for a school project, I would talk
to your teacher, because I am sure that s/he would be more than happy
to give you a few pointers on what would be a good practise.

If your reason for writing this is to have a movie database with your
own collection of movies, I would look around the net.
I recently wrote a opensource program that can do exactly what you are
after, it is still in development but since it is open source you can
get the source and hack away at it if you like.

regards
Daniel
www.daik.se (with a link to my mediaorganizer I mentioned in the post)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.