aspose file tools*
The moose likes Beginning Java and the fly likes What Platform/Java Technology  - Please Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What Platform/Java Technology  - Please Help" Watch "What Platform/Java Technology  - Please Help" New topic
Author

What Platform/Java Technology - Please Help

james bond
Greenhorn

Joined: Jan 23, 2005
Posts: 4
Hi, I am a uni student and have a final year java project to do.

The project must include:

1. a server side application that must run at specific times during the day (3 x a day) and store information to a database (MySQL).

2. a client side desktop application that will connect to the database and retrieve the information.

I have no problems writing the client side application. However, I am totally lost when it comes to knowing what server I need to have running the server side application and what type of java technology the server side application should use i.e EJB, entity beans etc??? How would the appliaction run at certain times, would I use a timer class? What would be the best way?

I would appreciate any advice you can give. Many Thanks.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
you're thinking way too complex.
You don't need any of that at all, just a few threads, a timer, and some network classes.
And of course JDBC to update the database.
It doesn't need a frontend at all, in fact it shouldn't output much of anything and that preferably to a logfile.

Sure you can go with complicated stuff like EJB and JMS but it's not needed.


42
james bond
Greenhorn

Joined: Jan 23, 2005
Posts: 4
Thanks Jeroen,

So you mean just a normal java application? What server would you use to run it on?

many thanks
Peter Rooke
Ranch Hand

Joined: Oct 21, 2004
Posts: 802

Again, maybe you are adding unneeded complexity. If you are taking the above advise [I think you should] - then you don't need a J2EE server.

Your project may be marked for 'fit for purpose' - if so then you may have to justify the technologies used. Can you make a list of reasons why a more complex J2EE application would be more suitable? Don�t use a sledgehammer to crack a nut!


Regards Pete
james bond
Greenhorn

Joined: Jan 23, 2005
Posts: 4
Thanks Peter,

Sorry i might be being a little dim. The project has to have a server side application to retrieve data form the web and then store in a database, surely this would need to be on some type of application server for example, Sun Java System Application Server would it not? if not can you please explain. I want my project to be as realistic as possible, as it would be implemented in the workplace. Client machines would then connect to the database for data. Mant thanks.
[ January 23, 2005: Message edited by: jamesb bond ]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Orion server works well for me, and it's free.
[ January 23, 2005: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Peter Rooke
Ranch Hand

Joined: Oct 21, 2004
Posts: 802

You could develop a simple server using threads, RMI (or sockets) and JDBC etc. Have a look at the SCJD forum. I've not done this [yet], but I do know that part of the assignment has similarities to what you are doing.

If you must go J2EE then JBoss [I also do like Orion]. You might like to look into Xdoclet.

Lastly - I think you need to find out what your project supervisor thinks
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
jamesb bond,

Welcome to JavaRanch! Please adjust your display name to meet the JavaRanch Naming Policy.
You can change it here.

Thanks!
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
serverside doesn't mean it has to run inside an application server!
Your simple application just runs in the background on the same machine that runs the application server (or the database server) and does its thing...
Many people aren't clear about what "serverside" means. Well, it means nothing more than that it's not on the client (which is usually interpreted as meaning someone's PC).
Taken STRICTLY the whole word is pretty meaningless of course as there is no real distinction between server and client. Most applications and computers are both at the same time.
Your application server (say Orion) is a server of content and data but a client to your database and your operating system.
That operating system is a server in that it provides services to applications but is a client to your hardware...
Your own application will serve data to the database which it retrieves as a client from a remote source.

As to Orion vs JBoss: Orion is far superior as well as being far easier to use.
It's free for noncommercial and educational use and cheap for commercial use.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
How about a plain old java application that is kicked off at certain times each day using cron (unix) or windows equivalent (task scheduler?)?

Use of timers in java has gotten better with recent releases, so that could work, but you'd still need some kind of process to check to make sure it's still running.
james bond
Greenhorn

Joined: Jan 23, 2005
Posts: 4
ok im starting to like the idea of a plain java application. I have only developed applications that run on my desktop. I am still confused as to how this application would be run. my tutor says that it needs to be on a server at the uni. if i develop a plain java application will this run on any server (machine)? so i dont need to worry about an application server or do I? what are application servers used for then?

Using a simple java app as suggested - is this a good way of implementing the system? rather than using enterprise beans etc?

many thanks
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
if i develop a plain java application will this run on any server (machine)?


This is the only part of your question that I feel qualified to answer. Typically, yes the application should run on any (machine) server as long as it has a JVM with the same (or later) version from the one you use to develop with. You may want to experiment with this by using a simple Hello World program to start.

Keep Coding!

Layne


Java API Documentation
The Java Tutorial
M Beck
Ranch Hand

Joined: Jan 14, 2005
Posts: 323
a "server" computer is no different in principle from any other computer - they run program binary files just the same as your desktop does, usually. i spent a couple years of a former life working with server and "enterprise class" hardware; it's not magical, trust me, i've got the scars to prove it.

in the case of Java programs, the difference ought to be even less than it otherwise might be; so long as that server computer has a functioning JVM on it, it should be able to run any Java class or jar file your desktop can, and all other things being equal, those classes and jars should run pretty much the exact same way, as well.

what you might want to know is which operating system the server in question is running. it will likely be either Windows 2003 or Linux/Unix. the difference is that these two have different command-line syntaxes used to start up programs, and different mechanisms for running a program at pre-set time intervals automatically. (they both have such scheduling functionality, but the schedulers in each work nothing alike.) so the incidental details of how your program is to be started might vary a bit, but the program itself should not have to - not if it's written in Java, at least not in principle.

i'm not really sure what "application servers" are supposed to be good for. hopefully someone will answer that question somewhere in this thread.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Originally posted by james bond:

Using a simple java app as suggested - is this a good way of implementing the system? rather than using enterprise beans etc?


Yes, Enterprise beans are overkill for your requirements.
You could complicate your design by turning it into a servlet running inside an application server that launches a thread which at regular intervals launches another thread which retrieves the data but why should you?

Always use the simplest solution that works, it's most likely the most efficient and usually the easiest to use and maintain.

Application servers have their uses, IF you need the special services they provide like distributed transaction management, HTTP client interfaces, etc. etc. which you don't.
They can provide a common well defined means for clients (meaning other applications) to access business processes, but as your application is an end-point (it writes its data to the database rather then sending it to someone else when requested to) there's no need for all that overhead.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I just read a nice definition of server: a program that waits for clients to connect. Usually the client sends a request, the server sends a response and the client either disconnects or sends another request. With such a simple definition, you can write a server with sockets in well under a page of code. Sun's All About Sockets tutorial includes "Writing a Client/Server Pair" which will get you a running start. If you go this route, jump up to the Sockets etc. forum and let us know how it goes!


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
he doesn't need to write a server...
He needs to write a client which updates a database which a server then queries (I surmise).
That client needs to run on the same machine as does the server, which is called the server as well usually (leading to the confusion as to what is a server in the first place).
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Hmmm, I read

The project must include:

1. a server side application that must run at specific times during the day (3 x a day) and store information to a database (MySQL).

as writing a server (defined as a program that waits for connections from clients) or a class that runs in some server obtained somewhere. It's about as easy to write a socket server as it is to figure out a server product.

Anyhow, Bond, let us know what you and Q come up with!
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
I read serverside as having to reside on the server, not having to be a server
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What Platform/Java Technology - Please Help