title: jTDS connection string for SQL Server Developer Edition with Service Pack 2
body: <p>I am and building an android app. Where my <code>ConnectionURL</code> is </p>
  
  <pre><code>ConnectionURL = "jdbc:jtds:sqlserver://" + server + ";"
                  + "databaseName=" + database + ";user=" + user
                  + ";password=" + password + ";";
  </code></pre>
  
  <p>Acc. to this answer: <a href="https://stackoverflow.com/questions/1862283/help-me-create-a-jtds-connection-string">Help me create a jTDS connection string</a></p>
  
  <p>The connectionString should have been </p>
  
  <pre><code>jdbc:jtds:&lt;server_type&gt;://&lt;server&gt;[:&lt;port&gt;][/&lt;database&gt;][;&lt;property&gt;=&lt;value[;...]]        
  
  jdbc:jtds:sqlserver://MYPC:1433/Blog;instance=SQLEXPRESS;user=sa;password=s3cr3t
  </code></pre>
  
  <p>Or, if you prefer to use getConnection(url, "sa", "s3cr3t"):</p>
  
  <pre><code>jdbc:jtds:sqlserver://MYPC:1433/Blog;instance=SQLEXPRESS
  </code></pre>
  
  <p>But, I am not using SQLEXPRESS. I using Microsoft SQL Server Developer Edition.</p>
  
  <p>What I have done is, one button click(android) the event occurs. Login form verifies UserName and Password and writes to new TextEdit. </p>
  
  <pre><code>package com.muchmore.mydatabase;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.annotation.SuppressLint;
  import android.content.Intent;
  import android.os.Bundle;
  import android.os.StrictMode;
  import android.support.v7.app.ActionBarActivity;
  import android.util.Log;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.sql.Statement;
  
  
  public class MainActivity extends AppCompatActivity {
       Button loginbtn;
       TextView errorlbl;
       EditText edname, edpassword;
       Connection connect;
       PreparedStatement preparedStatement;
       Statement st;
       String ipaddress, db, username, password;
  
       @SuppressLint("NewApi")
              private Connection ConnectionHelper(String user, String password,
                                      String database, String server) {
      StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
              .permitAll().build();
              StrictMode.setThreadPolicy(policy);
              Connection connection = null;
              String ConnectionURL = null;
              try {
                     Class.forName("net.sourceforge.jtds.jdbc.Driver");
  
                    ConnectionURL = "jdbc:jtds:sqlserver://" + server + ";"
                                   + "databaseName=" + database + ";user=" + user
                                   + ";password=" + password + ";";
                    /*
                    I was tyring to built a right connection string here. Please get it working :) 
                    ConnectionURL = "jdbc:jtds:sqlserver://localhost/"
                                   + "databaseName=" + "MyDatabase" + ";user=" + "sa"
                                   + ";password=" + "sa@123" + ";";
                    */
                   //private String URL =            "jdbc:jtds:sqlserver://localhost/brandix;instance=sqlexpress;useNTLMv2=tru‌​e;domain=workgroup"
                   connection = DriverManager.getConnection(ConnectionURL);
                   } catch (SQLException se) {
                         Log.e("ERRO", se.getMessage());
                   } catch (ClassNotFoundException e) {
                         Log.e("ERRO", e.getMessage());
                   } catch (Exception e) {
                         Log.e("ERRO", e.getMessage());
                   }
                 return connection;
               }
  
               @Override
               protected void onCreate(Bundle savedInstanceState) {
               super.onCreate(savedInstanceState);
               setContentView(R.layout.activity_main);
  
               loginbtn = (Button) findViewById(R.id.btnlogin);
  
               errorlbl = (TextView) findViewById(R.id.lblerror);
  
               edname = (EditText) findViewById(R.id.txtname);
               edpassword = (EditText) findViewById(R.id.txtpassword);
  
               ipaddress = "127.0.0.1";
               db = "MyDatabase";
               username = "sa";
               password = "sa@123";
               connect = ConnectionHelper(username, password, db, ipaddress);
               loginbtn.setOnClickListener(new View.OnClickListener() {
  
               @Override
               public void onClick(View v) {
                   try {
                        connect = ConnectionHelper(username, password, db, ipaddress);
  
                        st = connect.createStatement();
                        ResultSet rs = st.executeQuery("select * from login where userid='" + edname.getText().toString() + "' and password='" + edpassword.getText().toString() + "'");
                        if (rs != null &amp;&amp; rs.next()) {
                                  errorlbl.setText("Login Successful!!!");
                         } else {
                                  errorlbl.setText("Sorry, wrong credentials!!!");
                        }
  
                        } catch (SQLException e) {
                             errorlbl.setText(e.getMessage().toString());
                        }
                  }
      });
  </code></pre>
  
  <p>There is null reference in connect reference. So, I am sure there is some error in connection string. Otherwise my android code looks fine. Please see whats the right format of string.</p>