XML and JDBC combination into an adaptive application. Draft ==================================================================== Abstract It is a team project that would end up with a complete application using adaptive techniques. It requries team members with good knowledge in databases. The main idea is to get data out of a database and present them to the user. We can use JDBC to connect to any database and handle all kind of databases in a uniform way. From the database we would get the data and return them to the user as a standard XML document. The application can have two directions a) get data from the database according to the users inputs b) put new information into the database. We can start from the first direction because it can be implemented easier that the second. We assume that the database is given and the user cannot actually interfere with its schema and tables. He/she can just retrieve and/or insert information. ===================================================================== *************************************************** Analytican Description Direction one User -> Request -> database database -> response -> XML document ---------------------------------------------------- Interface The best interface for an adaptive program is an active web page. It is platform indepedent and can be used by anyone. The active web pages can be constructed dynamically using java servelts or java server pages (jsp). The jsp pages might be possible to be created using demeterj. So their maintainance would be adaptive. The user will be able to request the schema of the database and to run any standard SQL query that he/she wants. A more advanced option would be to allow the user to describe a transitive closure. Transitive closures cannot be executed with regular SQL but they can be executed using a programming language in combination with SQL. But this option is schema specific and it would be very difficult to be defined adaptively according to the database. To simplify things we might assume that we use a standard database were the schema is given and then the user would be able to either run any SQL query or ask for a transitive closure according to the given options. The interface would be a good idea to be handled by some student that has taken Human Computer Interaction or similar courses. ------------------------------------------------------ XML Document creator The XML document can easily be created using an XMLprintvisitor as described in one of the exeisting projects. There might be the need for some arrangements so that the XML print visitor take specific kind of input and return the XML. The problem in this situation is that the entire database cannot be turned into java objects because we assume that it has arbitrary size. So the XML document creator would have to take as input what is being returned from the JDBC connection only and create an XML document from that. This part can be done by someone with strong knowledge of XML and some knowledge of databases. Because the document created has to have a schema conforming with the existing database schema. ------------------------------------------------------- Database manipulation We assume that there is an existing relational database with arbitraty number of tables and entries in them. The idea is to handle the database with a Java program through JDBC. The main problem is with the schema of the database and how we would be able to access it. A good idea would be that the schema is given by the actual database administrator. JDBC connection allows the user to run SQL queries to a database and also allows integration of java with SQL. JDBC will behave similarly to any kind of database as long as the required connections are established. This part of the project will probably have to be programmed by hand and use some DJ techniques to handle the data. A good idea would be that a classgraph is created according to the database's schema. So all retrieved info are actually stored as java objects. This would allow traverse to be used extensively and it would be easier for the XML document creator to handle these objects. This part I believe is the most difficult part. It requires one or two students that are strong in databases, java and adaptive programming. It would be the most difficult part to implement in an adaptive way. ******************************************************** Direction two User -> Input -> XML document -> database -------------------------------------------------------- Interface The second direction can be based on the first one. The interface has to have more options. But this would be done easily with minor changes. -------------------------------------------------------- XML parser An XML parser is necessary. The parser has to check whether the schema in the xml document conforms with the database schema or at least with the table that the information are supposed to be inserted. Also the parser has to check is the data on the document conform with the XML schema. After all checking have been done the parser would break the document into java object and have them passed to the database manipulation part. I believe that a parser can be generated in an adaptive way by a student that is strong in XML. ---------------------------------------------------------- Database manipulation The third part of direction one has to be changed so that it allows data to be entered. Suppose that XML parser has checked the document for validity and compatibility. Then the data can be inserted using plain SQL INSERTs through the JDBC connection. This part would not be much difficult as long as the XML parser has done the appopriate checkings. ======================================================================== Final Comments: This project would involve coordinated team work and team members who are strong in XML, databases and java adaptive programming. If it can be completed than it would introduce a nice application for extracting/inserting information from/to a given relational database by using a simple information and the very versatile XML standard.