Hello Communtiy,

I need help because I try to connect my Android App API 21 programm with a SQL Anywhere 12 Database via wlan and the JConnect3.jar Driver. But it doesn't work. I have programmed the Android app with Android Studio.

The SQL Anywhere-Console give me this message when i try to connect the APP with the Database:

2016-03-16 10:57:41.643 TCP/IP: Verbindungsanforderung von 10.89.11.101:50946 erhalten

2016-03-16 10:57:41.643 Verbindung von 10.89.11.101:50946 wies Verbindungs_ID 4585 zu

2016-03-16 10:57:41.659 TDS 67: Verbindung erstellt

2016-03-16 10:57:41.659 TDS 67: Login 2016-03-16 10:57:41.659 TDS 67: TDS Version 5.0.0.0 wird benutzt

2016-03-16 10:57:41.862 TDS 67: Funktionalität

2016-03-16 10:57:41.862 TDS 67: Login: Benutzer fusion, Datenbank, Anwendung, Host localhost, Host-PID, Zeichensatz

2016-03-16 10:57:41.877 Verbindungs-ID 4585: fusion verbunden mit Datenbank „avista_test_lq" über TCPIP

2016-03-16 10:57:41.877 Verbindungs-ID 4585: AppInfo ist HOST = localhost

2016-03-16 10:57:41.877 Verbindungs-ID 4585: Server-Zeichensatzkonvertierung aktiviert, aber nicht erforderlich, zeichensatz „windows-1252“ wird verwendet.

2016-03-16 10:57:41.877 TDS 67: Anforderung abgechlossen

2016-03-16 10:57:41.936 Verbindungs-ID 4585: Verbindung „fusion“ nicht normal beendet

2016-03-16 10:57:41.936 Verbindungs-ID 4585: AppInfo des getrennten TCPIP_Clients ist HOST=localhost

2016-03-16 10:57:41.936 Verbindungs-ID 4585: „fusion“ Verbindung mit Datenbank getrennt. „avista_test_lq“
2016-03-16 10:57:41.936 Verbindungs-ID 4585: Client hat Verbindung getrennt

--> Because it doesn't work I wrote a little program in eclipse with the JConect3.jar Driver, the program will only connect to the database and the connection works.

The SQL Anywhere-Console give me this message when i try to connect to the Database:

2016-03-16 11:29:02:82 TCP/IP: Verbindungsanforderung von 10.89.11.101:50711 erhalten

2016-03-16 11:29:02:82 Verbindung von 10.89.11.101:50711 wies Verbindungs_ID 4628 zu

2016-03-16 11:29:02:82 TDS 68: Verbindung erstellt

2016-03-16 11:29:02:82 TDS 68: Login

2016-03-16 11:29:02:82 TDS 68: TDS Version 5.0.0.0 wird benutzt 2016-03-16 11:29:02:82 TDS 68: Funktionalität 2016-03-16 11:29:02:82 TDS 68: Login: „fusion“, Datenbank“, Anwendung“, Host „client 465“, Host-PID“, Zeichensatz“ 2016-03-16 11:29:02:82 Verbindungs- ID 4628: „fusion“ verbunden mit Datenbank „avista_test_lq“ über TCPIP 2016-03-16 11:29:02:82 Verbindungs- ID 4628: AppInfo ist HOST=client465

2016-03-16 11:29:02:82 Verbindungs- ID 4628: Server-Zeichensatzkonvertierung aktiviert, aber nicht erforderlich. Zeichensatz „windows-1252“ wird verwendet.

2016-03-16 11:29:02:82 TDS 68: Anforderung abgeschlossen

2016-03-16 11:29:02:82 TDS 68: RPC auführen: „sp-mda“ 2016-03-16 11:29:02:82 TDS 68: Eingabeparameter-Gruppe ………….

Now is my question why does it work in eclipse but in Android Studio not ??

asked 16 Mar '16, 08:37

hengber's gravatar image

hengber
11111
accept rate: 0%

1

In the non-working case, you are connecting via LOCALHOST, The working case connects with HOST=client465. As a starting point, you should ensure that the connection parameters used in both cases are the same.

(16 Mar '16, 09:19) Chris Keating

good idea but how i can define this parameter. The progran is the same in both cases, and i dont find a way to define the host.

(16 Mar '16, 13:56) hengber
Replies hidden

This is related to to jConnect connection code/configuration. It will be the Driver Connection URL i.e.,

Connection con = DriverManager.getConnection( "jdbc:sybase:Tds:localhost:2638", "DBA", "sql" );

(16 Mar '16, 14:09) Chris Keating

In both cases we use the exact same code.

try 
{
    DriverManager.registerDriver( (SybDriver) Class.forName("com.sybase.jdbc3.jdbc.SybDriver").newInstance());

    Connection connection = DriverManager.getConnection("jdbc:sybase:Tds:10.89.0.13:2637", "fusion", "fusion");

    if (connection != null) 
    {
        System.out.println("Verbinung geht");
    }
} 

so i have no idea where the client465 or the localhost came from.

(17 Mar '16, 04:15) hengber
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×77

question asked: 16 Mar '16, 08:37

question was seen: 476 times

last updated: 17 Mar '16, 04:24