RUS | UKR || DonNTU   Master's portal


                                                                                    1

AHMED KHALAF   ZAGER   ALSADY

  Faculty: Computer Science 

Speciality: Computer Systems and Networks

Scientific adviser: prof .Dr.LADYZENSKY.V


About author    

Research of java database technologies 

(Summary of research and developments)

The master thesis consists of introduction summary ,conclusion and reference the size of the thesis  amount to  134 page of the typescript , 35 figures 

 

The project aims begin covering JDBC concept and terminology and how java program can interface with relational database or any database that can be accessed using (SQL) .  The client-server architectures allows through JDBC (the Java Database Connectivity) the execution of SQL (Structured Query Language) instructions and the manipulation of the results in an independent and consistent manner. The JDBC API (Application Programming Interface) creates the level of abstractization needed to allow the call of SQL queries to any DBMS (Database Management System).

 

We discuss more detail of the java database connectivity  JDBC application  program interface (API) . the masseter degree provide the facility to calculate the process time of the completion of the operation through the java program and how map relational data onto java object ,mapping between SQL and JAVA data type limit the data onto java object limit the data created in a resultset ,constrain the time spend execute database update and delete operations in your java programs.

 

In this  research  an example with the complete code of the program is given for the best illustration of procedure of calculating  the process  time   in which any type of operation is completed after whole processing .in the program returns the current time of our system millisecond this has been use in the code of the program for getting process time by subtracting current time when the process is started and another time is completion on the process .our program was written for calculate how much of time take to get result of each query order which we write it by using SQL statement we have comparing the time every once we run the program with different SQL query. 

The application we build and  creation of two pages. In each of these pages you use (swing GUI forms)  to implement a simple interface. The two database tables, textlib and users, are contained in the MySQL database, call  javadb, which you create by completing the Connecting to a MySQL Database. Consider the following two-tier scenario

1



Introduction (Motivation)

Actuality  software developer has chosen  java because java has been tested refined ,extended ,and proven by dedicated community  . I t ’s the largest and most active on the plant .with its versatility , efficiency ,and portability, java  has become invaluable to developers by enabling them to :

·        Write software on one platform and run it on  virtually and other platform  Create programs to run within the Web browser and web services .

·        Develop server- side  application for online forums ,store ,polls,HTML form processing and more

·        Combine application or servicer using the java language to create highly customize application or services

·        Write powerful and efficient application for mobile phone ,remote processors ,low –cost consumer products ,and practically any other device with digital heartbeat 

Aims and purposes of the research :in the master degree we  discuss abut database system development using JDBC and SQL server .Experiment to estimate time of SQL queries   were concauted. The aim of master degree work is research of executes different SQL file using database and calculates time of each query and how work this program in JDBC. We have  applied the basic JDBC skill in some new ways, we have  been introduction to JDBC programing and seen it in action .We provide example  with the complete code of the program and seen it in action .We provide example with the complete code of the program is given for the best illustration of the procedure of calculating the process time in which any type of operation is completed  after whole processing .database servers are the most important part of internet .these servers store a lot of information and serve the huge amount of queries permanently. Improving a performance of database servers is vital task for  internet community .

Enhancing performance include writing SQL statement without using unproductive construction ,understanding and taking into account the physical structure of a typical database ,basing on practical experience and measurement of database system behavior .a classification of approaches to tanning of internet database server is proposed .

           

Survey of research and developments

Practical important of the obtain results : we will study the java technologies and MySQL database  service and study basic of JDBC and create java objects directly from JDBC data source  by adding a factory method to class to extract data from a ResultSet object and build a class object .and we will see how the statement interface provides methods that enable us to limit the field size and number of row that can be generated in a ResultSet.We can also set a maximum duration for  an SQL query .

Research method : The research uses the method of practical experiments and analysis of their result .in the program returns the current time of our system in nanosecond and convert it to millisecond.   

This has been used in the code of the program for getting process time by subtracting current time when the proceed is started and another time is completion time of the operation or the process .our program was written for calculate how much of time take to get result of each query  order which we write it by using SQL statement we have comparing the time every once we run the program with different SQL query .We have 36 SQL queries that we write it by SQL statement to select many parts from textlib.sql

The results of executing an SQL query are returned in the form of an object that implements the ResultSet interface and contains the table produced by the SQL query. The ResultSet object contains something called a cursor that you can manipulate to refer to any particular row in the resultset. This initially points to a position immediately preceding the first row. Calling the next() method for the ResultSet object will move the cursor to the next position. You can reset the cursor to the first or last row at any time by calling the first() or last() method for the ResultSet object. You also have methods beforeFirst() and afterLast() to set the cursor position before the first row or after the last. The previous() method for the ResultSet object moves the cursor from its current position to the previous row. This ability to scroll backwards through a resultset is dependent on your database and

whether your driver supports this capability

Usually you will want to process rows from a resultset in a loop, and you have a couple of ways to do this. Both the next() and previous() methods return true if the move is to a valid row and false if you fall off the end, so you can use this to control a while loop. You could process all the rows in a resultset with the following loop:

 

while(resultset.next())

{

// Process the row...

}

This code fragment assumes that resultset is the object returned as a result of executing a query and the resultset object starts out in its default state with the cursor set to 1 before the first row. You can  also use the isLast() or isFirst() methods to test whether you have reached the end or the beginning of the resultset.

Now you know how to get at the rows in a resultset; let’s look into how you access the fields in a row.

Assuming you have followed the instructions given at research , and have the requisite sample database and database driver installed on your computer , you are ready to look at a basic JDBC program that involves the following steps:

 

1. Import the necessary classes.

2. Load the JDBC driver.

3. Identify the data source.

4. Allocate a Connection object.

5. Allocate a Statement object.

6. Execute a query using the Statement object.

7. Retrieve data from the returned ResultSet object.

8. Close the ResultSet.

9. Close the Statement object.

10. Close the Connection object.

 

The JDBC architecture is based on a collection of Java interfaces and classes that together enable you to connect to data sources, to create and execute SQL statements, and to retrieve and modify data in a database. These operations are illustrated in Figure 4.8

2

Main planned results

Consider the structure of the system, which implements the task computing duration  transform data from MySQL server to client show in fig (2-20) .

System consist of four  main part  java application , MYSQL database ,java database connectivity , table continues to  computing duration  to data transform

3

4
5

Conclusions and future research

The main results of this master degree research work are :

     

1.     Ñconnectivity between the Java programming language and a wide range of databases – SQL databases and other tabular data sources, such as spreadsheets or flat files. The JDBC API provides a call-level API for SQL-based database access. The statement interface provides method that enable we to limit the field size and number of rows that can be generated in a resultset .we can also maximum for an SQL query .A prepared statement object encapsulates a parameterized SQL statement and provide method for us  to set values fro the parameters . placeholders for the parameter in the SQL statement are representation by question mark  

2.     When exception are thrown by JDBC      method ,a chain of SQL Exception objects can be linked together  .we can access successive object in the chain by call the getNext Exception () method  for each SQLException object in the chain .if problem are detected by JDBC that do not warrant throwing an exception ,an object of type SQL Warning is attached to the object originating the problem .SQL warning object can be attached to connection ,statement, and Result Set object .you can check for a warning by calling the get warnings() method for the JDBC object you are using to access the data base     

3.     JDBC technology allows you to use the Java programming language to exploit "Write Once, Run Anywhere" capabilities for applications that require access to enterprise data. With a JDBC technology-enabled driver, you can connect all corporate data even in a heterogeneous environment.

4.     JDBC provides a set of preferred mappings between SQL types and java types .the method provide for transforming data between your program and database also support conversions to other than preferred types.  

5.     Java Access Bridge for the Microsoft Windows Operating System makes it possible for a Windows based Assistive Technology to get at and interact with the Java Accessibility API. The Java Accessibility API is implemented in the Java Foundation Classes (JFC) Project Swing user interface

6.     Duration transform data from MySQL server database  to client java application   increases or decreases According to the number of fields of data required and the size of data

7.     computer give you duration  in nanosecond and we convert duration from nanosecond to  millisecond by this equation

8.     when application  this system    in different computer the    result table that contain the start time and end time and duration will be the result different  because the description of computer different from computer to anther  in CPU ,RAM ,hard disk  that mean the pried spending to proceeding this tasks will change  from computer to another

There  are suggestions for future work:

1.     The functionally at the server side could be extended by returning the meta-data about the result table .this would give the client side the opportunity of  Utilizing the result table without prior knowledge of the data type of each column at the moment all data is returning as astringe this could use in future ,but with first line possibly being the meta data of the columns this allow more concurrent connections to be allowed without overload the server .        

2.     The client side of the system could allow much greater access control over the database 

3.     As simple mechanism to secure the result table send to client, it  could easily be encryption using the security measure offered by Jeeves this would render meaningless any rogue attempt to access the data base     

 

...

References

REFERENCES

 

[01]               Marc  H, Advance in Database technology ,spring 2006

 

[02]

 

Todd M. Thomas, Java Data Access—JDBC, JNDI, and JAXP, CS 590, April  2002

 

[03]

 

Marty Hall, http://www.moreservlets.com, book © Sun Microsystems Press, Database Access with JDBC

 

[03]

ALAN R . Java database programing servlet&JDBC,2010

 

[04]

 

Ivor Horton’s, Beginning Java™ 2,JDK™ 5 Edition, 2005 by Ivor Horton

 

[05]

 

Vincent Rainardi, Building a Data Warehouse With Examples in

SQL Server, 2008

 

[06]

 

Hitachi Consulting ,SQL server 2005 analysis step by step  ,  United States of America., February 2006 by Hitachi Consulting

 

[07]

RoseIndia.net global services company that understand businesses and aims to deliver value to its customer through  its software solution  and service http://www.roseindia.net /jdbc/mysql/.

 

[08]

 

NEBIKER, S., Modul DBMS, The Kerberos Network Authentication Service (V5), Request for Comments RFC 4120 (Obsoletes RFC 1510), Network Working Group,  IETF Standards Track, July 2005

 

[09]

The JDBC API was designed to keep simple things simple .[electronic source ]-mode  .

 

[10]

Jesus Molina, Hardware implementation of an authentication protocol using Kerberos, Master’s Thesis, Universidad Polytechnic de Catalunya, 2000 htt:// java.sun.com/docs/books/tutorial /jdbc/inde

x.html .

[11]

Information technology ,peter keen, international center for information new york  2010

 

[12]

Arabic side contains of many software and we can download any program free mode of acess :htt://soft.vip600.com//

 

[13]

 

Developer shed manages –technologies wepside collectively known as the developer shen network  http://www.devshed.com/c/b/java