Menu

JTDS drive problem

Joe
2017-03-08
2017-03-09
  • Joe

    Joe - 2017-03-08

    I am trying to connect my application (Simple login app) to my local MS Sql database. It is a development server completely separate machine. I using a program as a test that many people online have used to connect to their servers. Im using the JTDS-1.3.1 driver. The program runs fine but doesn't connect. It basicaly times out. Now i can connect to the server in many ways even with a java program I wrote using the microsoft jdbc4.1 driver. Works fine. I can ping the port no problem. even telnet into server. So something else is wrong and I'm lost for things to try. The driver is imported properly into the app. I'm not sure what else to try. Can anyone help
    Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();
    ConnectionURL = "jdbc:jtds:sqlserver://" + server +";databaseName="+ database + ";port=80" + ";ssl=off" + ";integratedSecurity=true" + ";user=" + user+ ";password=" + password + ";";
    Thanks
    Joe

     
    • Bernd Eckenfels

      Bernd Eckenfels - 2017-03-08

      Check your port setting in the sql server configuration tool. It is unlikely that the TCP Listener is actually using port 80. 

      Gruss
      Bernd
      --
      http://bernd.eckenfels.net

      On Wed, Mar 8, 2017 at 10:04 PM +0100, "Joe" jmaggio@users.sf.net wrote:

      I am trying to connect my application (Simple login app) to my local MS Sql database. It is a development server completely separate machine. I using a program as a test that many people online have used to connect to their servers. Im using the JTDS-1.3.1 driver. The program runs fine but doesn't connect. It basicaly times out. Now i can connect to the server in many ways even with a java program I wrote using the microsoft jdbc4.1 driver. Works fine. I can ping the port no problem. even telnet into server. So something else is wrong and I'm lost for things to try. The driver is imported properly into the app. I'm not sure what else to try. Can anyone help

      Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();

      ConnectionURL = "jdbc:jtds:sqlserver://" + server +";databaseName="+ database + ";port=80" + ";ssl=off" + ";integratedSecurity=true" + ";user=" + user+ ";password=" + password + ";";

      Thanks

      Joe

      JTDS drive problem

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jtds/discussion/129584/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
      • Joe

        Joe - 2017-03-09

        we opened port 80 as well 1433. still no connection. SSL and IntergratedSecurity parms are just things I tried. No connection with or without them
        here is my logcat

        03/09 08:08:54: Launching app
        $ adb push C:\Users\jm\AndroidStudioProjects\login\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.test.jm.login
        $ adb shell pm install -r "/data/local/tmp/com.test.jm.login"
        Success

        $ adb shell am start -n "com.test.jm.login/com.test.jm.login.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
        Client not ready yet..Waiting for process to come online
        Connected to process 2767 on device Nexus_10_API_24 [emulator-5554]
        W/System: ClassLoader referenced unknown path: /data/app/com.test.jmaggio.login-1/lib/x86
        W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
        I/OpenGLRenderer: Initialized EGL, version 1.4
        D/OpenGLRenderer: Swap behavior 1
        I/Choreographer: Skipped 81 frames! The application may be doing too much work on its main thread.
        E/EGL_emulation: tid 2786: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
        W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8ebddda0, error=EGL_BAD_MATCH
        I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.
        I/Choreographer: Skipped 109 frames! The application may be doing too much work on its main thread.
        W/IInputConnectionWrapper: setComposingRegion on inactive InputConnection
        W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
        W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
        E/error here 1 :: Network error IOException: Connection timed out
        E/EGL_emulation: tid 2786: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH)
        W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x8de66920, error=EGL_BAD_MATCH
        Application terminated.

         

        Last edit: Joe 2017-03-09
  • Joe

    Joe - 2017-03-09

    Connection corrected. TCP/IP PORT 1433 was thought to be open but it wasn't.

     
  • Bernd Eckenfels

    Bernd Eckenfels - 2017-03-09

    BTW I think its not a good idea to open TDS connections from a mobile app to a database, especially not if this is a priveledged login. Not only because you might have connectivity problems if you do not use http, but also if its very hard to gurantee data consitency (its not impossible but rather seldomly done right). It is also a credential management nightmare and only scales to a few hundred well behaved clients

    And, you are doing too much on the main thread - for the sake of responsive applications dont do any (NET) Io in main threads or gui event threads.

     
    • Spike

      Spike - 2017-03-09
      Post awaiting moderation.
  • Joe

    Joe - 2017-03-10

    we wanted to build just a small warehouse application to be able to look up inventory and do movement transactions from a tablet via wifi. This would be inside the fire wall. No access from the outside. We thought this would be the fastest way right now. How would you suggest it be done? Any suggestion would be appreciated.

     

Log in to post a comment.