I'm new in android programming
I want to connect to the remote sql server 2008 but when I run the project it return this message : "com.microsoft.sqlserver.jdbc.SQLServerDriver"
**I think this error is for my connection string.**
my c# connection string is :
I want to connect to the remote sql server 2008 but when I run the project it return this message : "com.microsoft.sqlserver.jdbc.SQLServerDriver"
**I think this error is for my connection string.**
my c# connection string is :
PHP:
string connectionStr = "Data Source=arabbros.com\sql2008,2008;Initial Catalog=arabbros1;User ID=emad11;Password=112233"
now I want to change it to java connection string for remote sql server
and my code is :
public void run()
{
String connectionUrl= "jdbc:sqlserver://arabbros.com:1433;instance=sql2008,2008;databaseName=arabbros1;integ ratedSecurity=true;";
Connection con = null;
Statement stmt = null;
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
con = DriverManager.getConnection(connectionUrl,"emad11","112233");
stmt = con.createStatement();
ResultSet reset = stmt.executeQuery("select * from Table1");
txt.setText(reset.getString("Emd"));
con.close();
}
catch (Exception e)
{
txt.setText(e.getMessage());
}
}