.V
Lynn Guy wrote:
Actually, this was someone else's question but having just gone through it I was trying to get people to respond in a helpful manner. I didnt mean to cloud the issue by using SQLServer specifically, any dbase would do. I'm still in the process of filling in the holes for myself so this helps. Hope it helps the original uhum.."poor sod".
thanks
--- Kirk Wylie <[EMAIL PROTECTED]> wrote:
Then maybe the approach should be to state what I---------------------------------------------------------------------
think everybody's trying to convey:
1) You have to start with understanding how
SQLServer works within Java, in other words, learning JDBC.
2) You then have to understand how SQLServer works
in any type of web application (i.e. how you configure data sources in
a container environment). Your application server, no doubt, has
many different examples, though they may not explicitly give
SQLServer information (if you're worried, I've done this several times with
SQLServer with a variety of application servers).
3) Once you get to that point, you have to know
rough "best practices" for working with ANY database server in a Struts web
application. All the major Struts books cover this in some fashion.
There's nothing that I think we on the list could
say about using SQLServer specifically with Struts, because the two
are orthogonal. I've written several Struts applications on top of
SQLServer, and nothing in the JSP pages or the Struts code actually knows that
it's working with SQLServer at all (but then again I'm using
Hibernate).
Even if you (perish the thought... ;-) use SQL
directly from your Actions or JSP pages, Struts won't know about it.
You're in the realm of my #1 and #2 points: this is generic to using JDBC
in Web Applications (for the code) and SQLServer in Java (for the SQL
commands and driver trickiness).
If you want any specific tips as to how _I_'ve done
it, I'll be happy to provide them, but in general, I think that if you've
read a good set of documentation on points #1-3 it'll be pretty self
evident how it works together, in that Struts really won't know anything
about SQLServer.
Kirk Wylie
Lynn Guy wrote:
The issue is that the "poor sod" who doesnt know
it
all coming in has 2 stovepipes. Struts and
SQLServer
(or some other db). How does one get started when
the
app requires data from a database? Maybe struts shouldnt know about the database, fine. But
struts is
in the mix so there must be an approach/mechanism/something that gets the data to
the
page. Its not magic so where is the discussion of approaches to maintaining struts "ignorance" of
the db
while getting my organizationId from the db to the page?????
So far I've got: check out the datasource check some sort of configuration in the
webserver
check out object-relational mapping check out JDBC
the rest is to my imagination and if I get it
wrong
you all will be right there to point it out to me
later why I shouldnt have done that!
sorry, but its a pain in the (&*&&%(& to learn and
its
even harder when all the discussions ignore how
the
pieces fit together because they arent supposed to know about each other! Sounds like a catch22 to
me.
--- David Graham <[EMAIL PROTECTED]>
wrote:
> > --- Mark Lowe <[EMAIL PROTECTED]> wrote: > > > > On Wednesday, October 8, 2003, at 07:30 PM,
David
> Graham wrote: > > > > > > > > --- Mark Lowe <[EMAIL PROTECTED]> wrote: > > >> Godfrey > > >> > > >> I think what folks are trying to say is
that
> the SQL stuff is > > separate > > >> to the struts stuff, and this is kind of
what
> its about. There is a > > >> data source definition that confuses the
hell
> out of people new to > > >> struts as it seems to implicitly suggest
that
> it should be used. > > >> > > >> However most of the folks advise against
its
> use as it encourages > > >> breaking with MVC.. That said, there are > examples in the > > documentation > > >> and if you're used to quick dirty SQL in
html
> pages then using struts > > >> even when breaking MVC is still progress. > > >> > > >> You'll want some JDBC references and
> will find you some. > > >> > > >> when you've got the hang of doing SQL
(JDBC)
> stuff in your struts > > >> flavored webapp. I really dont know why
folks
> get so snobby about > > >> people breaking with MVC to get started.. > > > > > > I wouldn't describe the responses as
"snobby".
> The question was > > > confusing > > > because Struts has nothing to do with SQL
Server
> or database access in > > > general. You can code JDBC in Struts
actions
> just like a normal > > > Servlet > > > app. There is no "Struts way" to do
database
> access. > > > > I know that, you know that, some poor sod
with
> SQLServer and obviously > > little java experience perhaps doesn't. The > datasource configuration in > > struts config does can lead to folks think
there
> is.. > > I agree, and that's one reason I think the > <data-source> configuration > should be deprecated and removed. It served
its
> purpose in the beginning > but now IMO Struts really has no business
dealing
> with DataSources at all. > > David > > > > > > > > > > >> The funny thing is its the > > >> same folks recommending JSTL which have
SQL as
> part of the lib. > > > > > > That's like saying you shouldn't use JSP
because
> it lets you create > > > confusing scriptlets. You don't have to
use the
> JSTL's sql tags just > > > like > > > you don't have to use JSP scriptlets for
them to
> both be good > > > technologies. > > > > I guess what I said could be read like that..
But
> tags aren't the same > > as embedding java in your jsp's. At least you
can
> port the java code > > out of jsp's, and the java is still java.
The
> stuff you learn using > > scriptlets is useful across the board and
thus
> perhaps less of a waste > > of time. If you used SQL tags then what use
is
> that? Where you going to > > go with them? > > > > So no sorry, its not like saying scriptlets
are
> bad for this reason, > > its really quite different. > > > > Mark > > > > > > > > David > > > > > >> > > >> When you've done all that and you've seen
what
> a pain it can be, > > >> you'll > > >> naturally arrive at the point where you'll
hate
> SQL and be gagging > > for > > >> an object-relational bridge. But I'd worry > about this when you get > > >> here.. > > >> > > >> Hope this helps > > >> > > >> Mark > > >> > > >> On Wednesday, October 8, 2003, at 05:26
PM,
> Lynn Guy wrote: > > >> > > >>> Let's restate the question... > > >>> I'm new to struts and my database is SQL > Server. Can > > >>> someone point me in the correct direction > where to > > >>> find out how to set up an environment
that
> utilizes > > >>> these two to build an application? > > >>> > > >>> --- David Graham
<[EMAIL PROTECTED]>
> wrote: > > >>>> > > >>>> --- Jayson Falkner
<[EMAIL PROTECTED]>
> wrote: > > >>>>> Hi Godfrey, > > >>>>> > > >>>>> I can't think of any, but I'm positive
you
> would > > >>>> get some pointers if > > >>>>> you asked the Struts user list. I'll
send a
> copy > > >>>> this to the list. > > >>>>> > > >>>>> Does anyone know of a good Struts
tutorial
> that
> > >>>> also deals with using
> > >>>>> SQL Server?
> > >>>>
> > >>>> They are completely unrelated topics.
Struts
> > >>>> actions should never know > > >>>> where you're getting your data. > > >>>> > > >>>> David > > >>>> > > >>>>> > > >>>>> > > >>>>> Thanks, > > >>>>> > > >>>>> Jayson Falkner > > >>>>> [EMAIL PROTECTED] > > >>>>> > > >>>>> > > >>>>> On Tue, 2003-10-07 at 15:10, > [EMAIL PROTECTED] > > >>>> wrote: > > >>>>>> Hey Jayson, > > >>>>>> > > >>>>>> Know any decent struts tutorials when
using
> it > > >>>>>> on top of SQL Server? > > >>>>>> > > >>>>>> Hope all is well. > > >>>>>> > > >>>>>> Thanks > > >>>>>> > > >>>>>> Godfrey Nolan > > >>>>>> [EMAIL PROTECTED] > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>> > > >>>>> > > >>>>> > > >>>> > > >>> > > >
---------------------------------------------------------------------> > >>>>> To unsubscribe, e-mail: > > >>>>
[EMAIL PROTECTED]
> > >>>>> For additional commands, e-mail: > > >>>> [EMAIL PROTECTED] > > >>>>> > > >>>> > > >>>> > > >>>> __________________________________ > > >>>> Do you Yahoo!? > > >>>> The New Yahoo! Shopping - with improved > product > > >>>> search > > >>>> http://shopping.yahoo.com > > >>>> > > >>>> > > >>> > > >
---------------------------------------------------------------------> > >>>> To unsubscribe, e-mail: > > >>>>
[EMAIL PROTECTED]
> > >>>> For additional commands, e-mail: > > >>>> [EMAIL PROTECTED] > > >>>> > > >>> > > >>> > > >>> > > >
---------------------------------------------------------------------> > >>> To unsubscribe, e-mail: > [EMAIL PROTECTED] > > >>> For additional commands, e-mail: > [EMAIL PROTECTED] > > >>> > > >> > > >> > > >> >
---------------------------------------------------------------------> > >> To unsubscribe, e-mail: > [EMAIL PROTECTED] > > >> For additional commands, e-mail: > [EMAIL PROTECTED] > > >> > > > > > > > > > __________________________________ > > > Do you Yahoo!? > > > The New Yahoo! Shopping - with improved
product
> search > > > http://shopping.yahoo.com > > > > > > >
---------------------------------------------------------------------> > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > > >
---------------------------------------------------------------------> > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > __________________________________ > Do you Yahoo!? > The New Yahoo! Shopping - with improved product > search > http://shopping.yahoo.com > >
---------------------------------------------------------------------> To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] >
---------------------------------------------------------------------To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]