Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29883

Re: Java Web

Date 2014-09-01 15:04 +0100
From lipska the kat <lipskathekat@example.com>
Newsgroups comp.lang.java.programmer
Subject Re: Java Web
References <65c74098-cda8-482d-844d-8577ee514ef3@googlegroups.com>
Message-ID <kZadnXohJMhy4ZnJnZ2dnUVZ8r2dnZ2d@bt.com> (permalink)

Show all headers | View raw


On 01/09/14 14:15, sundu104ece@gmail.com wrote:
> Hi everyone,
>
> I am having confusions over jsp and jdbc.
> i am doing a small application in java web.I am having jdbc code which connects and retrieves the data from database.
> My questions:
>
> 1)Where do i have to write jdbc code?either in jsp or servlet or some other?
> 2)How can i display those data by jsp.
>
>
> Thanks in advance.

Try searching the interweb for "how to write a java web app"
The first non ad hit I got was
http://docs.oracle.com/javaee/1.4/tutorial/doc/WebApp.html
there are many others

Think of a web application as a multi layered entity
each layer should be as decoupled from the others as possible

In fact you should really develop your business components so that they 
can be used regardless of interface. The WWW is just one possible 
delivery mechanism.

It's a bit of a 'big question' really.
I'll give you a hint.

The persistance layer is one layer.
You need to be able to use your database access code from multiple 
possible interfaces, not just web apps?
So where do you think this code should go?

In a Servlet? well not really, this ties your code to a web application.
In a jsp? most certainly not, a jsp is a presentation layer technology
What does this leave?

...

So, now we wait for the howls of derision from the 'experts' on this 
list. No matter, it's an architectural decision you have to make and 
some architects just build *stupid* buildings.

-- 
lipska the kat - treacherous feline.
Proudly nominated for IPOTY 2014 - LIGAF
GNU/Linux user #560883 - linuxcounter.net

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Java Web sundu104ece@gmail.com - 2014-09-01 06:15 -0700
  Re: Java Web lipska the kat <lipskathekat@example.com> - 2014-09-01 15:04 +0100

csiph-web