Mariya Antony christopher wrote:I have tried database connectivity using context.xml.
The problem is it takes loading the page continuously for database insertion.
is there any additional parameters to be passed in context.xml
Tim McGuire wrote:
Mariya Antony christopher wrote:I have tried database connectivity using context.xml.
The problem is it takes loading the page continuously for database insertion.
is there any additional parameters to be passed in context.xml
I don't understand what you mean by "It takes loading the page continuously for database insertion". You have to keep reloading the page for successive queries to work? If you are seeing some database records inserted, that is not a connection issue. Would you share your code so we can better understand what is going on?
Tim McGuire wrote:
Mariya Antony christopher wrote:I have tried database connectivity using context.xml.
The problem is it takes loading the page continuously for database insertion.
is there any additional parameters to be passed in context.xml
I don't understand what you mean by "It takes loading the page continuously for database insertion". You have to keep reloading the page for successive queries to work? If you are seeing some database records inserted, that is not a connection issue. Would you share your code so we can better understand what is going on?
Wendy Gibbons wrote:
Tim McGuire wrote:
Mariya Antony christopher wrote:I have tried database connectivity using context.xml.
The problem is it takes loading the page continuously for database insertion.
is there any additional parameters to be passed in context.xml
I don't understand what you mean by "It takes loading the page continuously for database insertion". You have to keep reloading the page for successive queries to work? If you are seeing some database records inserted, that is not a connection issue. Would you share your code so we can better understand what is going on?
I am sorry but like Tim, I don't understand what your actual problem is?
is it throwing an exception?
is the update statement taking a very long time?
are you having to refresh the page many times?
Mariya Antony christopher wrote:
takes long time for database insertion
Tim McGuire wrote:you have no code for closing the connection and no try block, which makes me think this isn't your real working code?
If you are not closing the connection in a finally block, this could be gumming up your database.
Wendy Gibbons wrote:are you doing this inside a jsp file?
I was just wondering what all the <% %> are for?
Mariya Antony christopher wrote:
Wendy Gibbons wrote:are you doing this inside a jsp file?
I was just wondering what all the <% %> are for?
yes in JSP file only,any issues regarding using jsp file
Tim McGuire wrote:
Mariya Antony christopher wrote:
Wendy Gibbons wrote:are you doing this inside a jsp file?
I was just wondering what all the <% %> are for?
yes in JSP file only,any issues regarding using jsp file
There are many reasons not to do such things inside a jsp:
Readability. Use JSTL tags in the view. Keep the java code on the server side. Separation of Concerns - you should not mix presentation logic and business logic Reusability - are you going to write this same code over again for the subsequent .jsps you write? Maintainability - a database column changes and you will be hunting through all your jsps for places to change. better to do this on server side Breaks OOP - you cannot extend what you have done in a jsp Getting business logic out of jsp lets you take advantage of the java bean paradigm finally, due to the above, scriptlets (java code inside of jsp) are used today as a warning sign that a developer does not know what they are doing
Tim McGuire wrote:
Mariya Antony christopher wrote:
Wendy Gibbons wrote:are you doing this inside a jsp file?
I was just wondering what all the <% %> are for?
yes in JSP file only,any issues regarding using jsp file
There are many reasons not to do such things inside a jsp:
Readability. Use JSTL tags in the view. Keep the java code on the server side. Separation of Concerns - you should not mix presentation logic and business logic Reusability - are you going to write this same code over again for the subsequent .jsps you write? Maintainability - a database column changes and you will be hunting through all your jsps for places to change. better to do this on server side Breaks OOP - you cannot extend what you have done in a jsp Getting business logic out of jsp lets you take advantage of the java bean paradigm finally, due to the above, scriptlets (java code inside of jsp) are used today as a warning sign that a developer does not know what they are doing