![]() ![]() Just restart the server, you should not see any errors in the tomcat server logs. context.xml Īdd above ResourceLink in the context.xml file, it’s required so that applications can access the JNDI resource with name jdbc/MyLocalDB. server.xml Īdd above resource in the server.xml GlobalNamingResources element. Tomcat JNDI DataSource Configurationįor configuring tomcat container to initialize DataSource, we need to make some changes in tomcat server.xml and context.xml files. INSERT INTO `Employee` (`id`, `name`, `role`, `insert_time`) ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 `id` int(11) unsigned NOT NULL AUTO_INCREMENT, I am using MySQL for my example, below script is executed to create a simple table and insert some values into it. Hibernate DataSource JNDI Example Database Setup First of all we need to setup test database and JNDI DataSource in tomcat container. ![]() Using hibernate in web application is very easy, all we need is to configure DataSource properties in hibernate configuration file. We have already seen how to use Hibernate ORM tool in standalone java application, today we will learn how to use Hibernate with DataSource in Tomcat servlet container. Welcome to the Hibernate Tomcat JNDI DataSource example tutorial. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |