Well, this entirely depends on you. You can, say, create database connection
object of type java.sql.Connection via event listeners mechanism and set it
on servlet context via setAttribute() method and name it "myDbConnection".
Then in your servlet you can get it from servlet context and cast it to
java.sql.Connection:

 

java.sql.Connection myConn = (java.sql.Connection)
getServletContext().getAttribute("myDbConnection");

 

--

Regards,

Artashes Hovasapyan

 

From: java-ee-j2ee-programming-with-passion@googlegroups.com
[mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com] On Behalf Of
sospeter oluoch
Sent: 09 February 2009 13:30
To: java-ee-j2ee-programming-with-passion@googlegroups.com
Subject: [java ee programming] getAttribute method

 


When I use the getAttribute method in servlets, what should i pass as my
string parameter and how exactly do i know that the object being called has
the parameter specified?





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to