JTDS Android connect to SQL Server - Error Connection null -


"itemprop =" text ">

Hi im trying to connect this to my MS SQL Server 2008 R2 from my Android app: < / P>

  try {log.i ("login", "setting connection ..."); // SET CONNECTIONSTRING Class. ForName ("net.sourceforge.jtds.jdbc.Driver") NewInstance (); Log.i ("JDBC", "found"); Connection DbConn = DriverManager.getConnection ( "JDBC: jtds: sqlserver: // MyPC /" + dB + ", for example = SQLEXPRESS; user =" + USERNAME + ", password =" + password); Log.i ("Login" "Connected"); Statement stmt = DbConn.createStatement (); ResultSet insert = stmt.executeQuery ("Log in user login (user name, password) value (administrator, administrator);"); ResultSet reset = stmt.executeQuery ( "* Choose from Ugrlogin '); toast. Make text (it Risetkgetstring (1), toast. Elananjiacaiacoaraaraarti). Show (); DbConnkclose (); // Skip newsfeed} Grip (exception e) {log (e) "error connection", "" + e. Messages ());}  

im getting an error on this line:

  connection DbConn = DriverManager.getConnection ( "JDBC: jtds: sqlserver: // MyPC /" + dB + "eg = SQLEXPRESS; user =" + USERNAME + "; password =" + password ") ; Logkat error connection error with  

I jtds-1.3.1.jar am using I have database instance and define the actual database I have enabled TCP / IP, and I have enabled Windows and SQL authentication, as well as remote connections are allowed. Ive looked at other posts but no help is not sure what is wrong, any thoughts?


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -