Nothing Special   »   [go: up one dir, main page]

Chapter - 1 Synopsis: About Project

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 37

CHAPTER 1 SYNOPSIS

About project: XML Migration is a project to convert the existing Database like Oracle and MS-Access into the XML file format. Problem definition: In web, database is widely used at present. The database occupies some part of memory in the server and amount should be paid to maintain the database. The amount will depend upon the database size, and also Access and Oracle databases are platform dependent. XML is platform independent. While using databases, lot of problems will be arising like database Administrator support, Data corruption, huge memory spaces, and unnecessary expenses for database security. Project modules: In our project we use the following modules, Server accessing module. Data manipulation and administration XML code generation for the database. Preview of XML format. Intermediate tool kit creation for accessing XML file.

CHAPTER 2 COMPANY PROFILE


PORUS TECHNOLOGIES 10 & 11, Dr. Radha Krishnan Nagar, Ponnamallee High Road, Arumbakkam, Chennai 600 106 Ph: +91 44 42170209 We Porus Technologies are one of the Leading technical Support Provider in the field Of Software, Embedded systems and DSP, VLSI systems. We Offer Projects for Students of Final Year Engineering, and under and Post Graduates and we are in developing R&D activities in our company And Developing New Products in the field of Bio Medical and Embedded Systems. About Us: Strive to continuously improve our design & development processes to meet the needs of innovative applications in Electronics and IT industries. To share our vast of experience for education and knowledge enrichment in the field of electronics design automation, we provide the opportunity for students to do their projects in high-end technologies in a challenging environment. As per the Industry norms, we provide very good training in their chosen field. Not only we train as like students but also we treat them as a future employee by doing all the real time projects with full of industrial environment. Our projects and training make a student as a professional.

Job oriented training program is especially timely in view of the current job market and economic conditions. Our Strength: We are in Association with Various colleges to develop their students in Career Development and Job assistance for them. Our Projects students Have Been awarded first Prize For their project work in Annamalai University Chidambaram. Technical Areas in which we are Involved:

Global Positioning Systems Global Standard for Mobiles Radio Frequency Identification Bio-Metrics Real Time Operating Systems Programmable Logic Controllers Digital Signal Processing Very Large Scale Integration Web Technologies Microsoft Technologies Mobile Technologies

Some of the colleges Where We conduct In-Campus Training in embedded systems M.I.E.T Engineering College Gundur - Trichy.

Contact Details: Manager Operations: - A.Mohamed Rizwan B.E., Legal Advisors : 1. Prof. Dr. I.S.A. Hussain. (Former H.O.D .C. Abdul Hakeem College Vellore) 2. Prof. J.G.R. Sathiaseelan (Professor Computer Science, Bishop Heber collegeTrichy)

CHAPTER 3 SYSTEM STUDY


3.1 Existing System: For the past couple of years Internet applications have relied on

the databases installed in the servers for storage of information. An internet application which requires persistence data uses a

database provided by the hosting agency Usually corporate which uses the Internet solutions will have

Database servers running in their local Intranet. It will be very efficient if the company can use the existing databases. Since consolidation of data is quickly possible. Also in the administration point of view its very hard for the company to maintain the data. The Internet plays a major role in achieving the centralization of data and applications. This provides a mechanism for accessing the same resource from different locations all over the world. The major drawback of existing database oriented Internet application is deployed. 3.2 Need for the system: As described earlier, with the existing systems, database has to be present in the middle tire where the Internet application is deployed. For user this is very costly as deploying agency will be billing a huge amount for the usage of database. Moreover user is not having full control over the database And it is not possible to do DBA level administrations. So data consolidation (Data warehousing) is not possible.

Todays advancement in the field of data formatting with a clear separation between presentation and data has made the IT industrialists to rethink on the existing solutions and proposing a new system wherein actual data is saved in the applications tire in the file formats like XML. By using EDI standards this data can be transferred to any other location. So, we are going to develop a network component for downloading the XML document that contains data form the server, then to extract actual data from document using XML Parser and Transfer the data from XML file to RDBMS table residing on our local client machine. 3.3 Problem Definition: The very first step is to setup an Internet application that will

produce data as per XML format. This will be a web application hosted on standard web server. The network component checks the validity using a Login. The

Username and Passwords are stored in a separate database; the given password is checked for authentication against the user name. If there is a match, the user is allowed to enter in to the session,

failing which he is denied permission. If by chance there may happen a phonetic error, the user has to

re-login to establish his identity. New users need not undergo this password check; the very first time they try this project. However user names and passwords are registered, the very

first time itself and any future login needs a valid username and password.

Once logged in, then they both can use EDI standard to grab

the data residing in the web application or server using socket programming. Here we are saving the information in XML files that will be residing in the application tier. XML supports an elegant way of storing the data in a tag format as per the specification. This is very efficient since storing the data in to a flat file like XML file will be very quick. This completely avoids the need for having the database in server. The networking component we are writing will download the xml files over the Internet, Parse the data available in XML files and migrates the data to the database that will be available locally.

CHAPTER 4 SYSTEM REQUIREMENTS


4.1 Software Requirements: J2SDK 1.4.0 XML Parser Any RDBMS JSP

4.2 Hardware Requirements: Monitor : 800 x 600 minimum resolution at 256 colors

minimum Memory : Approximately 128 megabytes of onboard

memory I/O : Two or three button mouse and standard 101-key Keyboard MHz : At least 166 MHz processor

CHAPTER 5 SOFTWARE DESCRIPTION


5.1 J2EE: Origins of J2EE During the early `90s, traditional enterprise information system providers began responding to customer needs by shifting from the two-tier, client-server application model to more flexible three-tier and multi-tier application models. The new models separated business logic from both system services and the user interface, placing it in a middle tier between the two. The evolution of new middleware services - transaction monitors, message-oriented middleware, object request brokers, and others - gave additional impetus to this new architecture. At much the same time, the growing use of the Internet and intranets for enterprise applications contributed to a greater emphasis on lightweight, easy to deploy clients. Multi-tier design dramatically simplifies developing, deploying, and maintaining enterprise applications. It enables developers to focus on the specifics of programming their business logic, relying on various backend services to provide the infrastructure, and client-side applications (both standalone and within web browsers) to provide the user interaction. Once developed, business logic can be deployed on servers appropriate to existing needs of an organization. However, despite these clear benefits, the model limits developers' ability to build applications from standardized components, to deploy a single application on a wide variety of platforms, or to readily scale applications to meet changing business conditions. Within Sun Microsystems, several development efforts pointed us toward what would become J2EE technology. First, the Java servlets technology showed that developers were eager to create CGI like behaviors

that could run on any web server that supported the Java platform. Second, the JDBC technology gave us a model for marrying the "Write Once, Run Anywhere" features of the Java programming language to existing database management systems. Finally, the success of the Enterprise Java Beans component architecture demonstrated the usefulness of encapsulating complete sets of behavior into easily configurable, readily reusable components. The convergence of these three concepts -- server-side behaviors written in the Java language, connectors to enable access to existing enterprise systems, and modular, easy to deploy components -- led us and our industry partners to the J2EE standard. J2EE Application Model J2EE is designed to support applications that implement enterprise services for customers, employees, suppliers, partners, and others who make demands on or contributions to the enterprise. Such applications are inherently complex, potentially accessing data from a variety of sources and distributing applications to a variety of clients. To better control and manage these applications, the business functions to support these various users are conducted in the middle tier. The middle tier represents an environment that is closely controlled by an enterprise's information technology department. The middle tier is typically run on dedicated server hardware and has access to the full services of the enterprise. J2EE applications often rely on the EIS-Tier to store the enterprise's business-critical data. This data and the systems that manage it are at the inner-core of the enterprise. The J2EE application model provides the benefits of Write Once, Run Anywhere portability and scalability for multi-tier applications. This standard model minimizes the cost of developer training while providing the enterprise with a broad choice of J2EE servers and development tools. 10

The J2EE application model is a major step forward in simplifying and expediting application development, by minimizing the complexity of building multi-tier applications. Java Technology Foundation The J2EE application model begins with the Java programming language and the Java virtual machine. The proven portability, security, and developer productivity they provide forms the basis of the application model. The application model also includes the Java Beans component model. Java Beans components make easy the componentization of the Java technology-based code for common functions, then customize and combine these components visually with Java Beans development tools. Platform-Independent Security While other enterprise application models require platform-specific security measures in each application, the J2EE platform's security environment enables security constraints to be defined at deployment time. By shielding applications from the complexity of implementing security, the J2EE platform makes them portable to a wide variety of security implementations. The J2EE platform defines standard declarative access control rules to be defined by the application programmer/assembler and interpreted when the application is deployed on the enterprise platform. J2EE also requires platform vendors to supply standard login mechanisms so applications do not have to incorporate these mechanisms into their logic. The same program works in a variety of different security environments without change to the source code. As an example, a J2EE application developer can specify several levels of security (say user, super-user, and administrator), and then write code to 11

check the current user's permission level when accessing secure operations. At deployment time, the Application Deployer assigns groups of users to the appropriate security levels, enabling the application to easily verify permission level before performing the restricted operations. The Middle Tier The major benefit of the J2EE application model is in the middle tiers of multi-tier applications. In the J2EE platform, middle-tier business functions are implemented as Enterprise Java Bean components, as shown in figure. These enterprise beans allow service developers to concentrate on the business logic and let the EJB server handle the complexities of delivering a reliable, scalable service.

Figure: EJB Components Implement Business Logic in the Middle Tier Java Server Pages technology and servlets present middle-tier functions to the client tier as simple-to-access Internet-style services. Java Server Pages (JSP) technology makes it easy for user interface developers to present dynamically generated pages to anyone with a browser. Servlets give more sophisticated developers of Java technology-based applications the freedom to implement dynamic presentations completely in the Java programming language.

12

XML Parser: XML is an acronym that stands for Extensible Markup Language and represents a more general way of defining the text-based documents. XML descends from SGML (Standard Generalized Markup Language ) and is specifically targeted for use with the web. The greatest difference between HTML and XML is the flexibility of the allowable tags. In HTML any tag you can use must be taken from a fixed subset . An XML-based document, instead, can define its own tags, as well as include a set of tags defined by a third party. This kind of Flexibility relies on a parser that reads a document type definition for a specific XML document if one is available. By defining a new DTD you establish a set of rules and a set of tags creating de facto a new markup language. This may become very useful for those applications that need to deal with very complex data structures. A DTD is a text file that describes the syntax of the tags youre using in that class of documents. A DOM for XML is an object model that exposes the contents of an XML document. The W3Cs Document Object Model (DOM) Level 1 specification currently defines what a DOM should expose as properties, methods, and events. Microsofts implementation of the DOM fully supports the W3C standards and has additional features that make it easier for you to work with XML files from your programs. Using any parser data in the XML file can be extracted. Java Server Pages: Java Server Pages technology fills up the gap between the power of java on the web server and the power of HTML on the browser. It does so by allowing separation of content and presentation. This separation permits the Web Designers and programmers to work together to achieve a common 13

goal. JSP can be used equally well to deliver XML between the components of enterprise applications or to deliver WML to wireless devices. A JSP page is a text-based document that describes how to process a request to create a response. The description intermixes fixed template data with some dynamic actions. The semantic model underlying the JSP is that of a servlet. A JSP container, which is a component installed on a web server or a Web-enabled application server delivers a request received from a client to the _jspService () method of the class derived from the JSP page. This method, which is compiled form of the dynamic actions specified in the source JSP document, prepares a response that is delivered to the client via the JSP container. JSP pages are Platform independent, which means that they can be developed on any platform and deployed on any server. JSP pages also makes it easy to embed reusable components such as Java Beans and Enterprise Java Beans that perform specialized tasks can be developed once and incorporated into any no of Java Serer Pages. Java Server Pages technology is now an integral part of the Java 2 Enterprise Edition (J2EE), which brings Java technology to enterprise computing. By using JSP pages to construct your Web sites , you can create a front end component of the type of powerful N-tier applications made possible by J2EE. 5.2 Ms-Access: Here, let me present some of the features of Ms-Access. A database can be created in an easy manner.

14

All the tables, which are part of the database schema, should be

placed under the same database. Selecting the Create New Table option can do this. A table is created interactively using the Design option. The data types and width of each field should be specified here.

Primary and secondary keys can be set if required. Once a table is designed, we can enter the value for fields of the

records with the help of the Open option. We can import tables form other databases either of the same

type or DBF files belonging to other database systems. Only a drop in the ocean has been said about Ms-Access. To conclude, it can be used as a powerful back-end tool. 5.3 Oracle: ORACLE is a fourth generation relational database management system. In general, a database management system (DBMS) must be able to reliably manage a large amount of data in a multi-user environment so that many users can concurrently access the same data. All this must be accomplished while delivering high performance to the users of the database. A DBMS must also be secure from unauthorized access and provide efficient solutions for failure recovery. The ORACLE Server provides efficient and effective solutions for the major database features. ORACLE consists of many tools that allow you to create an application with ease and flexibility. You must determine how to implement your requirements using the features available in ORACLE, along with its tools. The features and tools that you choose to use to implement your application can significantly affect the performance of your application.

15

Several of the more useful features available to ORACLE application developers are integrity constraints, stored procedures and packages, database triggers, cost-based optimizer, shared SQL, locking and sequences.

16

CHAPTER 6 SYSTEM DESIGN


6.1 Phases of Development: User Authentication Initializing & Establishing connection with server Database Manipulation and Migration into XML file. XML data parsing Migrating the parsed data to a local database Connection termination Maintenance

User Login: The network component checks the validity using a login form. The

username and password are stored in a separate database; the given password is checked for authentication against the username. If the user is an authorized user he will be allowed to enter in to the session. Database Manipulation and Migration into XML file: Once the user has been logged in he could be allowed to manipulate the database like adding a record, editing a record or deleting the record from the database. We have used JDBC database connectivity to connect to the database server and get the record details and database metadata. Finally, the user can select the table and fields from the database to migrate the record values into XML file format. The user can save the generated XML code into database.

17

XML Parsing Using SAX Parser: Once the data is grabbed in to the local machine it has to be parsed to extract the data inside. JDBC Connectivity for migration of the data to RDBMS: The extracted data has to be ported to a database. This will be done by JDBC. This Software is a start to the next generation of software that separates the data and presentation.

18

6.2 Data Flow Diagram:

19

CHAPTER 7 TESTING AND IMPLEMENTATION


7.1 Testing: Testing represents a critical factor in application development. It can take up from to 50% of total development effort and depending on the size and complexity of the application. Formal approaches to system testing involve a description, which begins early that is in the program development phase. Unit Testing In a unit testing, the analyst tests the programs making up a system. This is also called program testing. The software units in a system are the modules and routines that are assembled and integrated to perform a specific function in a large system; many modules at different levels are needed. Unit testing is focusing on the modules independently to locate errors. This enables that tester to detect errors in coding and logic that are contained within that module alone. Those resulting from the interaction between modules are initially avoided. Unit test comprises the set of test performed prior to integration of the unit into the entire project. Four categories of tests are performed on each unit: Functional tests Performance tests Stress tests Structure tests

20

Functional Tests The code is exercised with nominal input values for which the expected results are shown. As well as boundary values (minimum values, maximum values) and values on and just outside the functional boundaries and special values such as logically related inputs. Performance Test Performance test is done to determine the amount of execution time spent in various parts of the unit, program throughput, and response time and device utilization by the program unit. Some time is taken initially to link to the SQL driver and getting connected to the SQL server at the back end. Once the connection is established, processed without any delay connection. Stress Test Stress test has been done to intentionally break the unit. This helps in learning about the string and limitations of the program by examining the manner in which a program unit breaks. Structure Test Structured test are done to test the internal logic of a program and traversing particulars execution paths. The major activity done in structured test is to decide which paths to exercise, deriving test data to exercise that path, determine the test coverage criteria to be used. Executing the test cases and measuring the test coverage achieved when the test cases are exercised. Integration Tests This is to develop an incremental strategy that will limit the complexity of interactions among components as they are added to the 21 records can be retrieved and will occur before getting the proper

system, developing an implementation and integration schedule that will make the modules available needed. In this test groups of the program modules are tested together to determine if they interfaces properly. This is done incrementally as they are developed until the program system is tested. In integration testing the product is tested to confirm our view of it at the specification and architectural design. Functional testing techniques are mainly used in the integration testing. During integration we choose portions of the structure tree of the software to put together. Each sub tree should have some logical reason for being tested; it is either implementing system function or part of the code essential to the function of the rest of the product. In this top-down integration is used. It proceeds down the hierarchy adding one module at a time until an entire true level is integrated. In the proposed system all the four modules are integrated in an effective manner and the integration test is conducted on all the four modules successively. Validation Test Computer input procedures are designed to detect errors in the data at a lower level of detail which is beyond the capability of control procedures. These are combined with the design of input process itself, reading data from the user. At the culmination of these, software is completely assembled as package interfacing errors which have been uncovered and corrected as validation succeeded when the software function in a manner that can be reasonably expected by the customer. Software validation is achieved through a series of black box test that demonstrate conformity with the requirement. Black box testing method focuses on the functional requirement of the

22

Output Test This test is conducted by giving sample value as input and then comparing output with the expected output .It comes under black box testing. The success of it depends on the value, which we are giving. In the proposed system the sample values are given to all the modules. Sample input values are compared with the expected output. If the output matches with the expected one, the success of the module will be determined. This test is one of the crucial tests in this phase. This test is conducted to determine the success of all the modules as a whole. Thus it breaks the performance of the whole proposed system. User Acceptance Test The user acceptance test has the objective of convincing the user on the validity and readability on the system. It is the moment at which we prove that we have really done what we promoted to do. This test is not the same as the one done at various stages of life cycle. It involves customer and intends check that the test dispose no errors at all. Using parallel testing what is used when the new software

implemented on existing system. Both the systems are executed with a common set of data and the correctness of the new software is determined by the degree to which it confirms to the existing responses. Successfully if conducted by the supervisor with the system analyst. Training gives confidence to cope with the new system. In this system, the evaluation system is very perfect and is made efficient than the existing one .In this new system has the high degree of performance than the existing manual system. The implementation process begins with preparing a plan for the implementation of the system. According to this plan, the activities have been carried out, discussions have been regarding the requested equipment

23

and resources. According to the above plan, the necessary equipment has to be acquired to implement the new system. Changeover Plan The changeover from old to the new one will take place here. The new system has been proved to the satisfaction to the system analyst, Operations manager as well as to the system users. Black box testing attempts to find errors in the incorrect missing function interface errors. Errors in the data structure and external database access, performance errors and initialization and termination errors 7.2 Implementation: It is the step in the project work that transforms the design in to a working model. It involves careful planning, investigation of the current system and the constraints on implementation, deploying of methods to achieve the change over, an evaluation of methods. Apart from planning major tasks of preparing for the implementation are educated and training to the users. Education Education is complementary to training. It brings life to formal training by explaining the background to the changes and resources for them. Education involves creating right atmosphere and motivating user staff. Training Training sessions must aim to give user staff the specific skills required in their new jobs. The training will be most important.

24

CHAPTER 8 CONCLUSION
Achievement Expected through the project: Low-cost and efficient data storage mechanism that can support quick data transmission and management. This solution provides a better utilization of network bandwidth and also reduces the traffic by which congestion This is very efficient since storing the data in to a flat file like XML file will be very quick. This completely avoids the need for having the database in server.

25

BIBLIOGRAPHY
George Reese, Database Programming With JDBC & Java 2ND Edition, O'Reilly Media, August 2000. Hanna, Phil, JSP 2.0: The Complete Reference, Second Edition, McGrawHill/Osborne Media, December 2002. Sanjay Mishra, Alan Beaulieu, Mastering Oracle SQL, O'Reilly & Associates, April 2002. Timothy J Oleary, Ms Office Access 2003 Introductory Edition, McGraw-Hill Companies, February 2004. Scott Means, The Book of Sax: The Simple API for XML, No Starch Press, March 2002 Jeni Tennison, Beginning XSLT, Apress, March 2004. Jonathan Gennick, Oracle DBA Queries Pocket Reference, O'Reilly Media, November 2000.

26

APPENDIX SAMPLE CODING


Code for displaying the Database Structure
<html> <head> <title>XML MIGRATION</title> </head> <body LEFTMARGIN=0 RIGHTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> <font color="#C0C0C0"> <%@page import="java.sql.*" import="java.io.*" import="java.lang.*" %> </font> <jsp:include page="banner.jsp"></jsp:include> <table style="position: absolute; left: 200px; top: 100px; height:447px" width=800> <tr> <td align="left" valign="top"><font color="#C0C0C0"><br><br><br><br><br> </font> <b><font color="#C0C0C0" size="5">&nbsp;&nbsp;&nbsp;&nbsp; DATABASE STRUCTURE</font></b><font color="#C0C0C0"><br><br> <%! String tn = ""; String fn = ""; String ft = ""; int fs ; %> <% String TabName = request.getParameter("LOFT"); %> <%!String url="";%> <% try { String database=session.getValue("mdbpath")+""; url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + database; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection(url,"",""); Statement st=con.createStatement(); String sql = "SELECT * from " + TabName ; ResultSet rset = st.executeQuery(sql); ResultSetMetaData rmdata=rset.getMetaData(); %> </font> <div align="center"> <center> <table border="1" width="392" height="188"> <tr> <td width="167" height="28"> <p align="center"><font color="#C0C0C0"><b>Field Name</b> </font> </td>

27

<td width="112" height="28"> <p align="center"><font color="#C0C0C0"><b>Field Type</b> </font> </td> <td width="81" height="28"> <p align="center"><font color="#C0C0C0"><b>Field Size</b></font></td> </tr> <%for(int i=1;i<=rmdata.getColumnCount();i++) { %> <tr> <%fn = rmdata.getColumnName(i); ft = rmdata.getColumnTypeName(i); fs = rmdata.getColumnDisplaySize(i); %> <td width="167" height="29"><font color="#C0C0C0"><%=fn%></font></td> <td width="112" height="29"><font color="#C0C0C0"><%=ft%></font></td> <td width="81" height="29"><font color="#C0C0C0"><%=fs%></font></td> </tr> <%} %> </table> </center> </div> <form name=f1 action="ADBStruct.jsp" method=post> <center> <a href="ADBStruct.jsp"> <font color="#C0C0C0"> <input type =submit value="Back"></font></a><font color="#C0C0C0"> </font> </center> </form> <font color="#C0C0C0"> <% rset.close(); st.close(); con.close(); } catch(Exception e) { } %> </font> </td> </tr> </table> </body> </html>

Code for Displaying the Data from the Database


<html> <head> <title>XML MIGRATION</title> <script> rec=0; function setfalse(rec1) {

28

var ch=document.disp.self; } function selone(index) { var ch=document.disp.self; try { if(ch[index-1].checked==true) { for(i=0;i<ch.length;i++) { if(i!=index-1) { ch[i].checked=false; } } } } catch(e) { } } </script> </head> <body LEFTMARGIN=0 RIGHTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> <font color="#C0C0C0"> <%@ page import="java.sql.*" import="java.io.*" import="java.lang.*" %> </font> <jsp:include page="banner.jsp"></jsp:include> <table style="position: absolute; left: 200px; top: 100px; height:447px" width=800> <tr> <td width="1127" rowspan="15" align="left" valign="top"> <font color="#C0C0C0"><br><br><br><br><br> </font> <h2><b><font color="#C0C0C0" size="5">&nbsp;&nbsp;&nbsp;&nbsp; TABLE DATA</font></b></h2> <font color="#C0C0C0"> <%String TabName = request.getParameter("DOFT");%> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font> <font size="2"><font color="#C0C0C0">Table Name :<%= TabName%> <%session.putValue("TabName",TabName); %> <%! String tn = ""; String fn = ""; String ft = ""; String fs = ""; String uname; String pass; String host; %> <% String uname = session.getValue("uname")+"";

29

String pass = session.getValue("pass")+""; String host = session.getValue("host")+""; //String TabName = request.getParameter("DOFT"); %> <% int nofr = 0;%> <%! String url="";%> </font> <form method=post action="aman.jsp" name="disp"> <b><font color="#C0C0C0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;Please Select an option</font></b><font color="#C0C0C0">&nbsp; <font color="#FFFF00"> <select name="action"> <option>Add New Record <option>Edit the Record <option>Delete the Record </select></font>&nbsp; </font> <font color="#C0C0C0"> <input type=submit value="Next"><br><br> <% try { String database=session.getValue("mdbpath")+""; url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + database; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection(url,"",""); Statement st=con.createStatement(); String sql = "SELECT * from "+TabName ; ResultSet rset=st.executeQuery(sql); ResultSetMetaData md = rset.getMetaData(); %> <br> </font> <table border="1"> <tr> <% int rec=0; for(int i=1;i<=md.getColumnCount();i++) {%> <td height="20"> <font color="#C0C0C0"><b><%=md.getColumnName(i)%></b> </font> </td> <%}%> </tr> <% while(rset.next()) { rec++; nofr++;%> <tr> <% for(int i=1;i<=md.getColumnCount();i++) {%> <td height="20"> <font color="#C0C0C0">

30

<% if(i==1) {%> </font> <font color="#C0C0C0"> <input type="checkbox" name="self" value=<%=rec+""%> }%><%=rset.getString(i)%> </font> </td> <%}%> </tr> <%}%> </table> <font color="#C0C0C0"> <% out.println("<br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp; Number of Fields : " + md.getColumnCount() + "<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number of Records : " + nofr + "</b>"); out.println("<br><br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp; Select a record to Edit or Delete"); out.println("<br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp; Select an option to do"); st.close(); rset.close(); con.close(); } catch(Exception e) { } %> <br> </font> </form> </td> </tr> </table> </body> </html>

31

SAMPLE

OUTPUT SCREENS

32

33

34

35

36

37

You might also like