• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

which java api?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've done some applet, servlet and JSP work. Now I want to write a program (or service if you will) that sits on top of a database. This program will receive request with parameter to look up the database (as it executes a SQL stmt) and then return the query result back to the requester.
This does not need a presentation layer, so no need for servlet or JSP(it would add overheads for the app server and alike).
I started look into RMI, JINI and even EJB. But they seems to have their overheads as well. All I need is a program that runs like service (never ends) and able to execute from remote calling froma client or some sort.
I know this is very vague, but I'm in the very early design stage!
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Who is sending the request? Is it over a network? Over the internet? Perhaps a web service would be a good solution.
 
john d
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
its most likely will be over the internet. I'm reading on web services, it sounds like web services is a combination of JMS, EJB, Servlet, and all the other XML APIs. I got the Java Web Services Tutorial and exmaples, from it I've noticed that all the client calls are through JSP / servlet. Is it possible to have clients calling a client class locally and it would look up the registry to get to the server for request ? any other useful tutorials out there on the web?
thanks
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John,
The reason most of the examples use jsp/servlets is because Web services are generally consumed(invoked) via the http or https protocols. This makes using web servies internet friendly.
Nonetheless, and properly programmed java applications using sockets can also consume(invoke) web services.
As for your solution, you can do a number of things:
1. Code the program that performs the database query as a server listening on a certain port for specific requests. When it receives the query, it responds with the result.
2. Use RMI
3. Use webservices. Probably your best bet because the protocols are clearly established and most client tools will be able to consume your web service.
-- Rodney
[ September 19, 2002: Message edited by: Rodney Woodruff ]
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem with RMI and sockets is that you have to have a separate port which isn't firewall friendly. You also have to worry about scalability issues. And you need some process to make sure that RMI doesn't go down for whatever reason. Using your servlet engine is easy because it's already there, it's firewall friendly, it's scalable, easy to secure, network admins already have processes in place to start it when it goes down, etc. So web services using http or https gets rid of all the headaches. That's why it so popular right now.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic