With warm regards, Manikanta Mogalluri
SCJP(90%), SCWCD(100%)
Author of ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- OCPJP Online Training -- Twitter -- How to Ask a Question
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Arnav Velimala wrote:
Write the JDBC code in JSP. And make an AJAX call to that JSP from your javascript.
Bear Bibeault wrote:
Arnav Velimala wrote:
Write the JDBC code in JSP. And make an AJAX call to that JSP from your javascript.
This is possibly the worst advice I have ever seen posted.
JDBC code has NO place in a JSP. Be sure to follow best practices and not pollute your JSPs with Java code -- especially database code.
The best way to satisfy your requirement is to use Ajax to access properly structured Java compoenents.
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Sam Mercs wrote:
Bear Bibeault wrote:
Arnav Velimala wrote:
Write the JDBC code in JSP. And make an AJAX call to that JSP from your javascript.
This is possibly the worst advice I have ever seen posted.
JDBC code has NO place in a JSP. Be sure to follow best practices and not pollute your JSPs with Java code -- especially database code.
The best way to satisfy your requirement is to use Ajax to access properly structured Java compoenents.
I would assume that Arnav meant using the proper archtecture to connect to the database - and that you would need to use Ajax & Server Side components (JSP included) to connect to the database. Of course - I agree being explicit would have helped...
Gregg Bolinger wrote:
Sam Mercs wrote:
Bear Bibeault wrote:
Arnav Velimala wrote:
Write the JDBC code in JSP. And make an AJAX call to that JSP from your javascript.
This is possibly the worst advice I have ever seen posted.
JDBC code has NO place in a JSP. Be sure to follow best practices and not pollute your JSPs with Java code -- especially database code.
The best way to satisfy your requirement is to use Ajax to access properly structured Java compoenents.
I would assume that Arnav meant using the proper archtecture to connect to the database - and that you would need to use Ajax & Server Side components (JSP included) to connect to the database. Of course - I agree being explicit would have helped...
Um, how did Arnav mean proper architecture when he specifically stated "Write the JDBC code in JSP" ? It's nice of you to defend him though.
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Gregg Bolinger wrote:The problem with that, Sam, is that from my experience those "example applications" often times wind up in production code. It's a whole lot better to just do it right from the get go. It requires much less work later on.
Write a DAO(Data Access Object) that fetches the required data from your database. Call the DAO from JSP.
And make an AJAX call to that JSP from your javascript.
Gregg Bolinger wrote:The problem with that, Sam, is that from my experience those "example applications" often times wind up in production code. It's a whole lot better to just do it right from the get go. It requires much less work later on.
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Oh. Hi guys! Look at this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|