Hélder Silva
- Forum posts: 1
Sep 1, 2012, 11:19:29 AM via Website
Sep 1, 2012 11:19:29 AM via Website
i am using a pc server online with sqlserver2008. and i want connect and access to my database"MaisRitmo2013" which is attached in my sqlserver2008 from management studio with my android.
i am using this code to example:
String driver = "net.sourceforge.jtds.jdbc.Driver";
String userName = "sa";
String password = "l0gitech";
int portNumber = 1433;
String serverName = "localhost";
Class.forName(driver).newInstance();
//test = com.microsoft.sqlserver.jdbc.SQLServerDriver.class;
// String connString = "jdbc:jtds:sqlserver://server_ip_address :1433/DBNAME;encrypt=false;user=xxxxxxxxx;password=xxxxxxxx;instance=SQLEXPRESS;";
// String connString = "jdbc:jtds:sqlserver://192.168.1.11:1433/MaisRitmo2013;encrypt=false;user=sa;password=l0gitech;instance=HELDERSILVA-PC\\SERVER2008;";
Properties connectionProps = new Properties();
connectionProps.put("user", userName);
connectionProps.put("password", password);
conn = DriverManager.getConnection("jdbc:jtds:sqlserver://" +serverName +":" + portNumber + "/", connectionProps);
// conn = DriverManager.getConnection(connString,username,password);
Log.w("Connection","open");
connectext.setText("Open");
can anyone help me doing this? sry my bad english
i am using this code to example:
String driver = "net.sourceforge.jtds.jdbc.Driver";
String userName = "sa";
String password = "l0gitech";
int portNumber = 1433;
String serverName = "localhost";
Class.forName(driver).newInstance();
//test = com.microsoft.sqlserver.jdbc.SQLServerDriver.class;
// String connString = "jdbc:jtds:sqlserver://server_ip_address :1433/DBNAME;encrypt=false;user=xxxxxxxxx;password=xxxxxxxx;instance=SQLEXPRESS;";
// String connString = "jdbc:jtds:sqlserver://192.168.1.11:1433/MaisRitmo2013;encrypt=false;user=sa;password=l0gitech;instance=HELDERSILVA-PC\\SERVER2008;";
Properties connectionProps = new Properties();
connectionProps.put("user", userName);
connectionProps.put("password", password);
conn = DriverManager.getConnection("jdbc:jtds:sqlserver://" +serverName +":" + portNumber + "/", connectionProps);
// conn = DriverManager.getConnection(connString,username,password);
Log.w("Connection","open");
connectext.setText("Open");
can anyone help me doing this? sry my bad english
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.