2. Prof. Rajan Datt, Dr. N.N. Jani, Mr. Sagar Modhavadia and Mr. Parth Kadecha
http://www.iaeme.com/IJARET/index.asp 2 editor@iaeme.com
1. INTRODUCTION
In today’s world every organization have to store their data in their own information
system. Information system used by organization are different and also their database
are different with development of system and the infrastructure. Different offices of
the government are established in different years with various infrastructure then its
database may be different from time to time, but it is the requirement of the
government to share their data between the various departments of the government for
taking important decisions. In this scenario it is need of the government to share or
integrate the databases of the various departments.
It is found that now days many organization is using service oriented architecture
with web service for the interoperability of the databases [1].
Here we are going to proposed model which will exchange the database of one
type in to another type using web service with the Service Oriented Architecture.
Web services are web application components which can be build, found and used
on the web. And it is a method of communication between two machine to machine
over a network. Such as we have developed an interface in which SQL database file is
given as argument in the function and as a output we get MY SQL database file with
same fields, same data type of those fields and constraints. Thus, on one server there
is SQL Server installed and on another server there is MY SQL installed and on third
server, the web service is running which translates SQL Server database file to MY
SQL database file. The technologies in which web services are written is WSDL.
WSDL (Web Service Descriptive Language) is an XML based language for
describing web services. UDDI (Universal Description, Discovery and Integration) is
a directory. It would then contact a special protocol called SOAP (Simple Object
Access Protocol) with Service Oriented Architecture (SOA).
2. RELATED WORK
Authors[3] have explained the problem of large scale data integration because of
design time user don’t know the structure of data , also traditional approach fail to
meet the data integration problem.
In this paper [4] authors have outlined the general problem of data exchange when
the data are stored on heterogeneous system. So they have proposed service oriented
architecture for data exchanging between application using heterogeneous databases.
The purposed framework proved to be an efficient solution for sharing and accessing
to heterogeneous data.
Structuring the scenario of smart meter data interface by comparing web service
technologies for smart meter data exchange. So in order to transfer data they used
various web technologies by judging the some criteria. In[5] qualitative comparison of
web service technologies provide a guidance for the right architectural design of smart
meter data exchange interface depending on the context and target use case.
In this paper authors [6] have focused on the gap of heterogeneous system
communication. Authors have constructed a framework which can use to transfer data
on heterogeneous system using web services. Data exchange platform realize the main
background relational database system using we service architecture.
Solution in the form of architecture to exchange data between the eHealth
systems. Here [7], proposed architecture using SOA and web service to shared
medication record of different eHealth system.
3. Databases Exchange Using Web Service Model
http://www.iaeme.com/IJARET/index.asp 3 editor@iaeme.com
Presented [8] the problem of patient data exchange between the medical
institution, hospital and insurance company, but the data are not in some format. As
result authors have purposed framework for medical information integration based on
ontology and web service to exchange or share data between different databases.
Author have developed framework using web technologies which has complete
encapsulation, loosely coupled, cross-platform and scalable to integrate medical
information.
3. IMPLEMENTATION
In implementation web service model we have created web service using visual studio
c# with ASP.Net. as interface we have created one form which allows the users to
select the database as source from which you can take database structure and allow
you to convert the database in either SQL Server or MY SQL(Vice Versa)
Figure 1 specified that this form will allow the user to select the database from SQL Server
database and convert into MY SQL.
Figure 2 specified that this form will allow the user to select the database from MY SQL
database and convert into SQL Server.
protected void btnConvert_Click(object sender, EventArgs e)
{
String connection_string = txtConnectionString.Text.Trim();
String db_name = txtDBName.Text.Trim();
if (db_name == "" || connection_string == "")
{
lblResult.Text = "* Invalid Input";
4. Prof. Rajan Datt, Dr. N.N. Jani, Mr. Sagar Modhavadia and Mr. Parth Kadecha
http://www.iaeme.com/IJARET/index.asp 4 editor@iaeme.com
return;
}
DataTransferWebService.DataTransfer wsobj = new DataTransfer();
if(wsobj.DataTransferService(connection_string,db_name))
{
lblResult.Text = "Result : Database Converted
Successfully...";
}
else
{
lblResult.Text = "Result : Problem in Conversion..";
}
}
Code: To connect with the Database and display message
[WebMethod]
public Boolean DataTransferService(String ConnectionString,string DataBaseName)
{
SqlConnection con;
try
{
con = new SqlConnection(@"" + ConnectionString);
}
catch
{
return false;
}
if (checkValidConnection(con))
{
MySqlConnection mscon = new MySqlConnection("Data
Source=localhost;UId=root;PWD=root;");
MySqlCommand mscmd;
try
{
mscmd = new MySqlCommand("CREATE DATABASE " + DataBaseName,
mscon);
mscon.Open();
mscmd.ExecuteNonQuery();
mscon.Close();
5. Databases Exchange Using Web Service Model
http://www.iaeme.com/IJARET/index.asp 5 editor@iaeme.com
}
catch {
return false;
}
mscmd = new MySqlCommand("USE " + DataBaseName, mscon);
mscon.Open();
mscmd.ExecuteNonQuery();
mscon.Close();
con.Open();
SqlCommand cmdTables = new SqlCommand("SELECT table_name FROM
INFORMATION_SCHEMA.TABLES", con);
SqlDataAdapter da = new SqlDataAdapter(cmdTables);
DataTable dtTables = new DataTable("tbl_tables");
da.Fill(dtTables);
// All table structure
for (int i = 0; i < dtTables.Rows.Count; i++)
{
SqlCommand cmdTableData = new SqlCommand ("SELECT
column_name,data_type,is_nullable FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name='" + dtTables.Rows[i]["table_name"].ToString() + "'", con);
da = new SqlDataAdapter(cmdTableData);
DataTable dt = new DataTable(dtTables.Rows[i]["table_name"].ToString());
da.Fill(dt);
String cmdStr = "CREATE TABLE " + dtTables.Rows[i]["table_name"] + "( ";
for(int j=0;j<dt.Rows.Count;j++)
{
string is_null = "";
if(dt.Rows[j]["is_nullable"].ToString() == "NO")
{
is_null = "NOT NULL";
}
if(j==dt.Rows.Count-1)
{
6. Prof. Rajan Datt, Dr. N.N. Jani, Mr. Sagar Modhavadia and Mr. Parth Kadecha
http://www.iaeme.com/IJARET/index.asp 6 editor@iaeme.com
cmdStr += dt.Rows[j]["column_name"].ToString() + " "
+dt.Rows[j]["data_type"].ToString() + "(50) " + is_null ;
}
else
{
cmdStr += dt.Rows[j]["column_name"].ToString() + " " +
dt.Rows[j]["data_type"].ToString() + "(50) " + is_null + ", "; } }
Code: for data transfer and fetch schema and define all structure
Here we have create web service using SQL Server with visual studio. We have
created web service with web method which allows the user to convert database from
one format to another format.
We have developed web service with some methods which can help us to convert
the database, also we have used some of the object of ADO.NET and information
schema for getting the structure of the databases.
4. RESULTS
We have implemented this service with database which is have various number of
records and we found that it is running successfully without any loss of the data from
the databases.
Table 1 conversion table (MY SQL to SQL Server)
MY SQL Records Response Time Success Ratio
Database 1 1000 25 milliseconds 100%
Database 2 5000 40 milliseconds 99%
Database 3 10000 60 milliseconds 95%
Table 2 conversion table (SQL Server To MY SQL)
SQL Server Records Response Time Success Ratio
Database 1 1000 20 milliseconds 100%
Database 2 5000 44 milliseconds 97%
Database 3 10000 55 milliseconds 96%
We have implemented the web service model on different database with the
number of various records and we found that it is converted the database successfully.
We have also tried to implement it with minimum time with minimum response time.
5. CONCLUSION
This research purposes to use of web service as a potential middleware to fulfil the
need of data exchange. So we have developed a general web based service which
implement to exchange the database format from one type to another type.We need to
conduct further investigations on designing and implementing Quality of service
module that give confirmation of reliability, availability and achievement. But still