Any OS except for Windows uses forward slashes '/' instead of backslashes for separating path elements. Your screen shot shows something like
<IP ADDRESS>\<XYZ> Which is probably interpreted as the domain name as a whole and therefore cannot be resolved. Try using forward slashes instead. On Thursday, July 26, 2012 9:23:02 PM UTC-5, Andre St-Onge wrote: > > I try to connect to my SQL database to do some syncronisation > And I' block on this kind of message > Unable to resolve host name ??? > > I use Windows seven with SQL Express database > I build a .NET application and I want to syncro address book to my new > Nexus 7 with Jelly Bean android > I use my lan and I can go to web easy, but I can't connect to my SQL > database. > > my ManifestAndroid.xml contain this lines > > manifest > xmlns:android="*http://schemas.android.com/apk/res/android"*<http://schemas.android.com/apk/res/android%22> > package="com.example.com.andre.repartiteur2" > android:versionCode="1" > android:versionName="1.0" > > <uses-sdk > android:minSdkVersion="16" > android:targetSdkVersion="15" /> > <uses-permission android:name="android.permission.INTERNET"/> > <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" > /> > <application > android:icon="@drawable/ic_launcher" > android:label="@string/app_name" > android:theme="@style/AppTheme" > > <activity > android:name=".MainActivity" > android:label="@string/title_activity_main" > > <intent-filter> > <action android:name="android.intent.action.MAIN" /> > <category android:name="android.intent.category.LAUNCHER" /> > </intent-filter> > </activity> > <activity > android:name=".OrderScreen" > android:label="@string/title_activity_order_screen" > > <meta-data > android:name="android.support.PARENT_ACTIVITY" > android:value="com.andre.repartiteur2.MainActivity" /> > </activity> > </application> > </manifest> > > Here is my code I used > and where is Yellow is where I catch the error > > public class ClasseSQL { > String Message = "<p>I'm into my sql class<p>"; > public String getMessage() { > return this.Message; > } > public void setMessage(String value) { > this.Message = this.Message + "<p>" + value; > } > public void dbConnect(String db_connect_string, > String db_name, > String db_userid, > String db_password) > { > StrictMode.ThreadPolicy policy = new > StrictMode.ThreadPolicy.Builder().permitAll().build(); > StrictMode.setThreadPolicy(policy); > Connection conn = null; > String connectionUrl = null; > try { > this.setMessage("loading class jtds..."); > //2012-07-26 use jtds instead of jdbc > //net.sourceforge.jtds.jdbc.Driver > //com.microsoft.sqlserver.jdbc.SQLServerDriver > Class.forName("net.sourceforge.jtds.jdbc.Driver"); > this.setMessage("class jtds loaded ..."); > connectionUrl = "jdbc:jtds:sqlserver://" + db_connect_string + ";" + > "databaseName=" + db_name + ";user=REPAPP;password=REPAPP;"; > this.setMessage("Open my connection...<p>" + connectionUrl); > // Establish the connection. > conn = DriverManager.getConnection(connectionUrl); > if (conn !=null) { > Statement statement = conn.createStatement(); > String queryString = "select [UID_Region],[Description] from > [dbo].[Courtage] WHERE [NumeroAvantage] <>''"; > ResultSet rs = statement.executeQuery(queryString); > while (rs.next()) { > this.setMessage( rs.getString(1)); > } > } > } > catch (SQLException se) { > this.setMessage("SQLException : " + se.getMessage() + "<p>" + > se.getCause() + "<p>" + se.getStackTrace() + "<p>"); > } > catch (ClassNotFoundException e) { > this.setMessage("Class not found") ; > } > catch (Exception se) { > this.setMessage("Exception error: " + se.toString() + "<p>" + > se.getCause() + "<p>" + se.getStackTrace() + "<p>"); > this.setMessage(connectionUrl); > } > } > } > > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en