Note that there are some explanatory texts on larger screens.

plurals
  1. POCan`t connect to SQL server from Android
    primarykey
    data
    text
    <p>I want to get connected to SQL server from an Android. I want to access the data from SQL server. But it is not getting connected. Please help me to solve this.</p> <p>I have included <strong>jtds-1.2.7.jar</strong></p> <p>Here is my <code>MainActivity</code> (I mention where I got an error in program) :</p> <pre><code>try{ String driver = "net.sourceforge.jtds.jdbc.Driver"; Class.forName(driver).newInstance(); conUrl = "jdbc:jtds:sqlserver://192.168.1.15 :1433/Retail_MB;encrypt=fasle;user=sa;password=123;instance=SQLEXPRESS;"; uname = "sa"; pass = "123"; /////// On this statement it gives error... connect = DriverManager.getConnection(conUrl,uname,pass); Statement statement=connect.createStatement(); rs=statement.executeQuery(str); while(rs.next()){ Log.w("Data:",rs.getString(0)); } connect.close(); } catch (Exception e){ Log.w("Error connection","" + e.getMessage()); } </code></pre> <p>It gives the <strong>error on DriverManager.getConnection(conUrl,uname,pass);</strong></p> <p>The error is an IOExeption:</p> <pre><code>socket failed: EACCES (Permission denied) </code></pre> <p>This is my <strong>Manifest :</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.alphahms" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name="com.example.alphahms.MainActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; </code></pre> <p></p> <p>What is the problem? Android and SQL Server experts please Help me.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload