This blog is going to explain how to design java database access model?. It contains 3 part, 1st part is for database model code, 2nd part is for access model code and 3rd part is for stored procedure sql code.
Database access model is used to connect database, retrieve records and passing input/output parameters using Stored Procedures. All the connections and transactions are in one class file. Designed simple method which is used to connect database and to produce the result set.
In the class file, one method is taking care of connecting the database, another method is to retrieve the result set and last method is doing for insert, modify and delete the record.
Showing posts with label JNDI. Show all posts
Showing posts with label JNDI. Show all posts
Thursday, October 7, 2010
Monday, September 27, 2010
Java Naming and Directory Interface (JNDI) with Environment Variables
The environment allows you to define your variables name, value and type. At runtime the environment values are not allowed to modify.
Declared the environment variables using the <env-entry> tag in the deployment descriptor (WEB-INF/web.xml in Tomcat). The elements of the <env-entry> tag are:
* <description>: an optional description.
* <env-entry-name>: the entry name.
* <env-entry-value>: a value.
* <env-entry-type>: the java variable type(Boolean, Byte, Double, Character, Float, Integer, Long, Short, String).
Declared the environment variables using the <env-entry> tag in the deployment descriptor (WEB-INF/web.xml in Tomcat). The elements of the <env-entry> tag are:
* <description>: an optional description.
* <env-entry-name>: the entry name.
* <env-entry-value>: a value.
* <env-entry-type>: the java variable type(Boolean, Byte, Double, Character, Float, Integer, Long, Short, String).
Wednesday, August 25, 2010
How to configuring a SQL Server datasource in Apache Tomcat using Java Naming and Directory Interface (JNDI) InitialContext Program?
Download the latest sql server database driver and place it into the lib folder. Restart Tomcat server, once the below changes are done.
1. web.xml configuration
Go to Tomcat root directory -> then explore webapps directory -> select cos (i.e., it is your project folder) and finally select WEB-INF folder. Open web.xml file, if not one, then create web.xml configuration file. Add the below code after <web-app> root tag.
1. web.xml configuration
Go to Tomcat root directory -> then explore webapps directory -> select cos (i.e., it is your project folder) and finally select WEB-INF folder. Open web.xml file, if not one, then create web.xml configuration file. Add the below code after <web-app> root tag.
Subscribe to:
Posts (Atom)