Lesson41 -- Connect Tomcat's JNDI to our project

1) Changing /conf/server.xml file in Tomcat's configuration:
Into '<GlobalNamingResources>' tag adding new '<Resource>' tag:

<Resource name="jdbc/global_phonebook" auth="Container" type="javax.sql.DataSource" maxTotal="100" MaxIdle="30" MaxWaitMills="10000"
username ="****" password="*****" driverClassName = "com.mysql.jdbc.Driver"	  url="jdbc:mysql://localhost:3306/phonebookWeb"/>

--> Creating new global resource with name "jdbc/global_phonebook".

2) Adding into 'webapp'-folder new 'META-INF' folder with 'context.xml' file.
In this file I'm binding global resource with local name 'jdbc/phonebook', where database information stores.

3) "ConnectionHolder" class becomes mush smaller than it was.