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


Groups > comp.lang.java.programmer > #29882 > unrolled thread

Java Web

Started bysundu104ece@gmail.com
First post2014-09-01 06:15 -0700
Last post2014-09-01 15:04 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  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

#29882 — Java Web

Fromsundu104ece@gmail.com
Date2014-09-01 06:15 -0700
SubjectJava Web
Message-ID<65c74098-cda8-482d-844d-8577ee514ef3@googlegroups.com>
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.

[toc] | [next] | [standalone]


#29883

Fromlipska the kat <lipskathekat@example.com>
Date2014-09-01 15:04 +0100
Message-ID<kZadnXohJMhy4ZnJnZ2dnUVZ8r2dnZ2d@bt.com>
In reply to#29882
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web