Quantcast
Channel: Questions Tagged With connection
Viewing all 98 articles
Browse latest View live

Android Ultralite database connection - Errors

$
0
0

I am not that experienced in Sybase systems but I am keen to learn.

I have a simple android application that I am trying to connect to a Ultralight DB. This DB is stored in my project built on Android Studio 0.3.1. I've added the file ultralitejni12.jar in my libs and added it as library and I am able to do reference import in my java class without a problem. I even get intellisense help on this. Then I copied the DB (with extension <*.udb>) file into my assets in the project directory. The full path in windows explorer looks like this: (C:AndroidDevAnroidStudioSampleAppProjectSampleAppbuildexploded-bundlesComAndroidSupportAppcompatV71900.aar). I don't know if this should be the right directory to put it but believe me I already tried the 'libs' location but to no avail. The code I am using to connect to the database came straight from Sybase after Googling around but it's generating funny errors like ; "Gradle: cannot find symbol class ULjException" "Gradle: package com.ianywhere.ultralitejni12 does not exist".

Every attempt to rebuild does nothing for me. Please help...

packagecom.lebel.sampleapp;//importandroid.content.Context;//importcom.ianywhere.ultralitejni12.*;//importjava.sql.Connection;//importstaticcom.ianywhere.ultralitejni12.DatabaseManager.*;importandroid.content.Context;importcom.ianywhere.ultralitejni12.ConfigFileAndroid;importcom.ianywhere.ultralitejni12.Connection;importcom.ianywhere.ultralitejni12.DatabaseManager;importcom.ianywhere.ultralitejni12.ULjException;importstaticcom.ianywhere.ultralitejni12.DatabaseManager.connect;importstaticcom.ianywhere.ultralitejni12.DatabaseManager.createConfigurationFileAndroid;/***CreatedbyLebelon11/11/13.*/publicclassDatabase{privatestaticDatabase_instance=null;privatestaticConnection_dbconn;privatestaticfinalintdefaultPort=2639;privatestaticfinalStringdefaultUsername="dba";privatestaticfinalStringdefaultPassword="sql";privatestaticfinalStringdb="lebeldb.udb";privatestaticfinalStringLOG_EXCEPTION="Database Connection Error";Context_context;privateDatabase(Contextcontext)throwsULjException{_context=context;if(_dbconn==null){ConfigFileAndroidconfig;config=createConfigurationFileAndroid(db,_context);config.setConnectionString("haa");config.setUserName(defaultUsername);config.setPassword(defaultPassword);config.setPageSize(8192);try{_dbconn=connect(config);}catch(Exceptione){_dbconn=DatabaseManager.createDatabase(config);}}}protectedstaticDatabasegetInstance(Contextcontext)throwsULjException{if(_instance==null){_instance=newDatabase(context);}return_instance;}}

Since the above class is a singleton my calling code in the Activity that I'm using is as follow:

packagecom.lebel.sampleapp;importandroid.app.Activity;importandroid.content.Context;importandroid.os.Bundle;importandroid.widget.ArrayAdapter;importandroid.widget.ListView;importcom.ianywhere.ultralitejni12.*;importjava.sql.Connection;importjava.sql.PreparedStatement;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.util.ArrayList;importjava.util.List;/***CreatedbyLebelon11/11/13.*/publicclassactStaffListextendsActivity{privateList<String>StaffList;//privatestaticContextcontext;publicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.lyt_viewstaff);//context=this.getApplicationContext();try{setupViews();}catch(ULjExceptione){e.printStackTrace();}}privatevoidsetupViews()throwsULjException{try{Connection_dbconn=(Connection)Database.getInstance(this.getApplicationContext());Stringqry="SELECT TOP 10  Test FROM Test";PreparedStatementps=_dbconn.prepareStatement(qry);ResultSetrs=ps.executeQuery();StaffList=newArrayList<String>();while(rs.next()){//StaffList.add(rs.getInt(1));//StaffList.add(rs.getInt(1));//StaffList.add(rs.getString(rs.getOrdinal("StaffID")));StaffList.add(rs.getString(0));}rs.close();ps.close();//PopulatelistviewhereListViewlv=(ListView)findViewById(R.id.lvStaffList);lv.setAdapter(newArrayAdapter<String>(this,android.R.layout.simple_list_item_1,StaffList));//}catch(ULjExceptione){//e.printStackTrace();}catch(SQLExceptione){e.printStackTrace();}}}

Difficulty connecting to ver 11 DB server on peer-to-peer network

$
0
0

This seems to be a problem which has developed only recently. Using SQL Anywhere version 11 build 2308 32 bit, on two separate customer sites (one using Windows 7 computers and one using XPs), I have had to add a HOST=xxx.xxx.xxx.xxx statement in the ODBC configuration to get the client computer to connect to the server. Then everything functions fine. These are simple two or three computer peer-to-peer networks. dblocate on the client can't find any servers but I can ping the server's IP address and connect with the HOST parameter.

Windows Firewalls are on, and I have put entries to allow dbsrv11.exe both inbound and outbound.

Any help would be appreciated. Thanks.

Sybase ASA 7 Connect issue

$
0
0

Hello,

I am new to Sybase having been an Oracle user for the longest time. I am working with a Database user that has no Password but is a Member of a group. What I need to understand is how is this user able to connect to the database?

I am not clear on how it does it.

Thanks

Store actual Mobilink synchronisation status on the SQL Anywhere remote

$
0
0

I have a Consolidated database with one Remote database (both SQL Anywhere 16 databases and Mobilink 16). I want to collect the Remote synchronization status (connection failed, last synchronization time, last error etc) and update it each time (changes) in a table on the remote database. What approaches/architecture/services on the remote do I have to use without using the dbmlsync API? My preference is to do it completely inside the remote database in SQL, is that possible?

ASA server startup double network card mode. The client can't search

$
0
0

ASA server startup double network card mode. The client can't search server

  • LAN1:192.168.1.80
  • LAN2:192.168.1.81

Extracting data using Informatica gives error first time

$
0
0

Hi ,

I am using informatica 9.1 which is extracting data from source database SYBASE IQ and the target database is Oracle.I have properly configured the connection. The mapping is valid and once the mapping is valid i create a workflow. The workflow is also valid.

When I run the workflow for the first time I am getting the below error

Database driver error...CMN_1022 [523 92[Sybase][ODBC Driver][Adaptive Server Anywhere]Database server not foundDatabase driver error...Function Name : ConnectDatabase driver error...Function Name : ConnectDatabase Error: Failed to connect to database using user [edw] and connection string [DWHSYBASEIQ_READER04].]

When I mannually execute it for the second time it is succesfully getting executed.

I am really not sure what could be the issue.

Please help me on the above?

Regards

Connection-Pooling Problem

$
0
0

Hello,

i have a problem with my connection-pooling in my sa-12 server. In my programm is often open and close connections (for nearly every query). After a while, i get the error message that the maximum of poolsize is reached. if i take a look in Sybase Central, there are a lot of Connections with the type: "CONNECTPOOLCACHE".

If i add CPOOL=No to my connection-string, nothing changed. There are also a lot of connections.

Does anybody else had this problem and got a solution?

Thank you!

SQLANYWERE SERVER 10 - CONNECTIONS HANGS

$
0
0

Hi, I have a SqlAnyWhere 10 server running with appr. 37 databases on a Windows 2008R2 64bit server. The server runs nice for some days but then connections will not close even if the Client closes the application that holds the connection. Have anyone experienced and solved this?

Sten-Inge


Server using SQL 9 and PC's are using SQL 11

$
0
0

Our servers in our dental offices are using SQL 9 and we started to upgrade the pc's in the office using SQL 11 users are complaining that the charts are freezing and locking up. Could this issue be caused by using the different versions of SQL

Switching dbsrv and dbeng

$
0
0

I am trying to get data off two devices that use SQL Anywhere 9 databases. They both currently run dbeng and I would like to use dbsrv instead so I can query the data from a central location.

I have read this article, but it's kind of lost on me because I'm not starting the process and I don't know what options are being used or assumed to be a specific default value.

I've been thinking about just renaming dbsrv9.exe to dbeng9.exe. It seems to work okay, but I don't want to do it in the live environment and have it break down the line, or find out that data hasn't been recorded properly in 6 months.

Is this an absolutely terrible idea? Is there another way around this? If it does seem like an okay idea, is there anything I can check to make sure that everything is working as expected?

sql Permissions changed

$
0
0

I need some help. I recently ran this grant command created database roundcube ran

grant ALL on roundcube to user1@"localhost" identified by "" with grant option;

Now any previous webpages that used user1 can not authenticate

Database error. could not connect to the database server (localhost,user1)

Any help is greatly appreciated.... Help. what exactly changed?

how to access database

$
0
0

Hello I am new to sqlanywhere have experience from MSSQL I have not really figured how to use sqlanywhere tools to access a running databse to view index, database structure and so on.

does someone have any starter information to get me going ?

thank you in advance.

Communication function sconn::receive code 4

$
0
0

I have opened the new question as Jeff asked me to ...

I indeed would love to download the EBF ... but since the absorption into SAP, which we were not told about (go figure why?), we can no longer download those EBFs ...

Ironically, no one can even tell us how to PAY for a support contract.

Here's the link back to the original question:

http://sqlanywhere-forum.sap.com/questions/10636/communication-function-sconnreceive-code-4

FYI, this issue is exactly the same for both SQL Anywhere 12 and 16 from the 'bad' machine. Finally, I did try with the ip address, without host name - same exact result.

TCP using Winsock version 2.2
IPv6 support enabled
Starting database "abi16UC" (C:\gemsql\abi16UC.db) at Thu Jul 31 2014 10:50
Transaction log: abi9-12.log
Starting checkpoint of "abi16UC" (abi16UC.db) at Thu Jul 31 2014 10:50
Finished checkpoint of "abi16UC" (abi16UC.db) at Thu Jul 31 2014 10:50
Cache size adjusted to 2668K
Database "abi16UC" (abi16UC.db) started at Thu Jul 31 2014 10:50
Database server started at Thu Jul 31 2014 10:50
Trying to start SharedMemory link ...
SharedMemory link started successfully
Trying to start TCPIP link ...
Starting on port 2638
Starting UDP listener on IP address 192.168.58.41:2638
Starting UDP listener on IP address (::1):2638
Starting UDP listener on IP address 127.0.0.1:2638
Looking for server with name abi16uc
Sending broadcast to find server
Using broadcast address of: 192.168.58.255
Looking for server with name abi16uc
Sending broadcast to find server
Using broadcast address of: ff02::1
Looking for server with name abi16uc
Sending broadcast to find server
Using broadcast address of: 127.255.255.255
Server not found (no reply received)
TCPIP link started successfully
Now accepting requests
Starting TCPIP listener on IP address (::):2638
Starting TCPIP listener on IP address 0.0.0.0:2638
Cache size adjusted to 709244K
TCP/IP: Received connection request from 192.168.58.41:54508.
Connection from 192.168.58.41:54508 assigned connection ID 1
Connection ID 1: Client disconnected

[Sybase][ODBC Driver][SQL Anywhere]Connection error: Timeout occurred while waiting for connection response
SQLCODE=-832
SQLSTATE=08001
Connection parameters: User= Password=*** Host=ABI-2012-04 B.absolutebrilliance.local:2638 Server=abi16uc LINKS=TCPIP ENC=NONE

C:\Users\administrator>ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::547e:eba7:4a20:75b8%11
IPv4 Address. . . . . . . . . . . : 192.168.58.41
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.58.1

Tunnel adapter isatap.{6C2EF952-2F54-4F69-8170-2336EE12C9B3}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Tunnel adapter Teredo Tunneling Pseudo-Interface:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

What happens to a connection when an app crashes, and how does it work?

$
0
0

SA 12.0.1.3046, Delphi XE, AnyDAC DB layer

Troubleshooting an issue where I've created a simple locking scheme that is usually handled just fine by the app itself, however I did create an event (Disconnect) that should delete the lock record based on connection ID upon disconnect (the connection ID is part of the lock record, so it is a simple DELETE FROM LOCKTABLE WHERE CONNECTIONID= ? fired from the event upon disconnect).

Somehow we are getting into a state where our app goes down (not quite sure on this one yet) and those connections stay open, and the events never fire. Even a reboot of the workstation that made the original connection has no effect (thought there might be some process holding them open even though I couldn't find any even with Process Explorer (sysutils)).

So, my question is, generally speaking, should I always expect connections to be dropped (no pooling, btw) if the app that made the connection is no longer in memory (regardless of how that came to be)? Can someone explain to me how Sybase knows that it occurred and resets the connections (which is the only behavior I can reproduce...my events fire every time)? Can the server settings -tl and -ti set to zero have anything to do with it?

I do see similar postings referring to undroppable connections, but I'm not quite ready to blame the server until I have a clearer view of what I should expect from an unexpected crash.

Ultralite sync on second thread preventing updates on the main thread

$
0
0
  • 11.0.1.2960 MobiLink
  • 11.0.1.2878 Windows Mobile .NET client

We have developed a Windows Mobile 6 solution that does an automatic, periodic UL synchronization on a separate thread. It works great as long as there is a decent wifi connection. When in parts of the facility where the wifi is weak, however, it starts having trouble. What appears to be happening is that the automatic sync starts but then it gets the database into a state where it seems to be waiting for the ability to update rows on the main thread.

[EDIT] The docs say: "During the upload phase, UltraLite applications can access UltraLite databases in a read-only fashion". So do update requests on a non-syncing thread wait for the upload phase to complete? Or are they supposed to immediately fail?

Anyway, one of three things usually happens from there:

  1. the user gives up and resets the device
  2. the user waits long enough with the very poor connection that eventually the sync completes successfully and the waiting updates go through on the main thread (but it's an unacceptably long time).
  3. the wifi connection gets so bad that the sync terminates with ULException - SQLE_COMMUNICATIONS_ERROR and the waiting updates on the main thread then go through successfully

The automatic sync is kind of expendable for the user...at least it's more of a nicety; if it’s doesn't happen from time to time, it really doesn’t matter. If there is a poor connection, the ideal would be to not sync at all, or at least cancel the sync after 3-5 seconds of not completing the sync. Unfortunately connection based timeout for .NET is not possible according to the docs:

ConnectionTimeout property: This feature is not supported by UltraLite.NET.

But often there may not even be a timeout occurring since the sync ultimately, usually, completes if given enough time....so maybe such a timeout wouldn’t help anyway??

The auto syncs are scheduled to occur often (like every 30 seconds), so there is very little data that ever needs to sync, and they're typically of very short duration when the wifi signal is strong (like 5 seconds maybe less)....so even if some timeout that was not based on the communication layer but on the length of the sync time itself was available, that would be nice. I don't think that's possible, but is there an option along those lines to emulate....say, for example, killing the automatic sync's thread--would that be an acceptable and safe option??

So in summary I guess these are my questions:

  • Is this a known behavior...the inability to write to the database when a sync on another thread is "spinning" or trying to communicate or even during a certain phase of a sync that it is stuck at because of poor communication?
  • Is there a non-destructive way to cancel an "expendable" sync after a certain amount of time? or even a way to cancel the sync if we see a user is trying to write to the database on the main thread?
  • Do you see any other ways to deal with this situation?

Sorry for the length of this post and thanks for reading this far and for any help you might impart.


SAConnection Problem SQL Anywhere 12

$
0
0

I am attempting to connect to an SQL Anywhere 12 database via VB.NET VS2008.

When attempting to use connection string setting different parameters I get an "Invalid User ID or password". Yet the User id and password is correct.

If I set the connection string with a DSN= it works fine.

I am using the SAConnectionStringBuilder.

enter code here
Public Shared Function GetActiveConnection(ByVal hostName As String, ByVal serverName As String, ByVal databaseName As String, ByVal userName As String, ByVal password As String, ByVal authentication As String) As SAConnection
        Dim connBuilder As New SAConnectionStringBuilder
        connBuilder.Host = hostName
        connBuilder.ServerName = serverName
        connBuilder.DatabaseName = databaseName
        connBuilder.Integrated = "False"
        connBuilder.UserID = userName
        connBuilder.Password = password
        connBuilder.ConnectionTimeout = 60
        Return New SAConnection(connBuilder.ConnectionString)
    End Function

Public Shared Function BuildConnectionString(ByVal hostName As String, ByVal serverName As String, ByVal databaseName As String, ByVal userName As String, ByVal password As String, ByVal authenticationMode As String) As String Return GetActiveConnection(hostName, serverName, databaseName, userName, password, authenticationMode).ConnectionString.ToString End Function

Public Shared Function ConnectStringOK(ByRef ConnectString As String) As Boolean Try Dim cConnect As String = ConnectString Dim sqlC As New SAConnection(cConnect) sqlC.Open() sqlC.Close() Return True Catch ex As Exception Return False End Try The connect string is constructed as: "UserID=dba;DatabaseName=NTTest;ServerName=TSTSyb12;Integrated=False;Connection Timeout=60;Host=SVR"

It appears the Error source is "SQL Anywhere .NET Data Provider", with "Invalid USer ID or password"

Any ideas?

UltraliteJ I/O error if device sleeps

$
0
0

Hello everyone,

I have an Android method that runs in background performing some DML executions. However, if the device "Moto G" is put in sleep (I could not reproduce this error in any other device), after some minutes the Ultralite starts to thrown the following error for every single SQL execution in the opened connection:

Error[-305]: I/O error 200020 [Interrupted system call,0,312]

Any ideias what is going on?

I've been trying to get a solution for this, but I actually have no idea what to do next.

Visualize in real time CPU and RAM consumption of sql connections

$
0
0

I want to keep track of which connection use most of resources.

Within Sybase Central (SQL Anywhere 9, 12), for each server and database, we have pane to check in real time All Connected Users and Connections.

How to check for each connect it's cpu and ram consumption (in real time)?

What might be defeating DoBroadcast=NONE?

$
0
0

The situation is that we want client machines to connect to a database sever by server (and engine) name - not IP address. This is so that we can update a DNS server to point to a different machine when required (eg a warm-standby server) without having to change thousands of ODBC DSNs.

To this end we use DoBroadcast=NONE in the connection strings eg:

UID=MyUser;PWD=**;DBN=IQX;ENG=IQX;CON=IQXUser51;LOG=C:\iqx.log;LINKS='TCPIP{host=iqx.group.com;DoBroadcast=NONE}'

On some machines this works exactly as expected. In this (slightly artificial) test the wrong server is running at 10.200.129.10:2638 and the correct server is 10.200.129.11:2638 but is not running - we did it that way to be sure of what was happening. Pinging the server name (iqx.group.com) correctly resolves to 10.200.129.11. So we would expect the client to ignore the server at 10 and then fail to connect to the one at 11 - which is exactly what happens:

Mon Jan 12 2015 14:40:40
14:40:40 Attempting to connect using:
UID=MyUser;PWD=**;DBN=IQX;ENG=IQX;CON=IQXUser51;LOG=C:\iqx.log;LINKS='TCPIP{host=iqx.group.com;DoBroadcast=NONE}'
14:40:40 Attempting to connect to a running server...
14:40:40 Trying to start TCPIP link ...

14:40:40 TCP using Winsock version 2.2 14:40:40 My IP address is 10.200.128.204 14:40:40 My IP address is ::1 14:40:40 My IP address is 127.0.0.1 14:40:40 TCPIP link started successfully

14:40:40 Attempting TCPIP connection (address 10.200.129.10:2638 found in sasrv.ini cache)

14:40:40 DoBroadcast=NONE specified, ignoring cached address 14:40:40 DoBroadcast=NONE specified, skipping LDAP check 14:40:40 Looking for server with name iqx 14:40:40 Trying to find server at address iqx.group.com 14:40:41 TCP/IP link, function connect(), error code 10061 14:40:41 Failed to connect over TCPIP

14:40:41 Removing failed address from sasrv.ini cache

14:40:41 Not attempting to autostart server 14:40:41 Cannot connect to server

However on another machine with the same OS (Windows 7 Pro SP1, where again iqx.group.com correctly resolves to 10.200.129.11) we get this:

Tue Jan 13 2015 17:07:06
17:07:06 Attempting to connect using:
UID=MyUser;PWD=********;DBN=IQX;ENG=IQX;CON=IQXUser55;ASTOP=YES;INT=NO;DBG=YES;LOG=C:\odbc_iqx.log;DMRF=NO;LINKS='TCPIP{host=iqx.group.com;DoBroadcast=NONE}';COMP=NO
17:07:06 Attempting to connect to a running server...
17:07:06 Trying to start TCPIP link ...

17:07:06 TCP using Winsock version 2.2
17:07:06 My IP address is 10.200.128.202
17:07:06 My IP address is ::1
17:07:06 My IP address is 127.0.0.1
17:07:06     TCPIP link started successfully

17:07:06 Attempting TCPIP connection (address 10.200.129.10:2638 found in sasrv.ini cache)

17:07:06 DoBroadcast=NONE specified, ignoring cached address
17:07:06 DoBroadcast=NONE specified, skipping LDAP check
17:07:06 Looking for server with name iqx
17:07:06 Trying to find server at address iqx.group.com
17:07:06 Found server, verifying server name
17:07:06 Found database server at address 10.200.129.10:2638
17:07:06 Found database server iqx on TCPIP link
17:07:06 Connected using client address 10.200.128.202:55607
17:07:06 Connected to server over TCPIP at address 10.200.129.10:2638

17:07:06 Connected to SQL Anywhere Server version 11.0.1.2960
17:07:06 Application information:
17:07:06 IP=10.200.128.202;HOST=MG001669;OS='Windows Vista Build 7601 Service Pack 1';PID=0xb24;THREAD=0x12e8;EXE=C:\PROGRA~1\iqx\Program\pears.exe;VERSION=10.0.1.4310;API=ODBC;TIMEZONEADJUSTMENT=0
17:07:06 Connected to the server, attempting to connect to a running database...
17:07:06 [15208] Connected to database successfully
17:07:07 [15208] The number of prefetch rows has been reduced to 0 due to the prefetch buffer
17:07:07 [15208] limit. Increasing the PrefetchBuffer connection parameter may improve performance.

In this case - although the client is recognising the DoBroadcast setting it is still managing to end up connecting to the wrong server. This may not be a SQL Anywhere problem at all - but how does the client go about finding the server by name once it's been told to ignore sasrv.ini - it is using the DNS or some other method?

NB - I'm not quite sure where the DBG setting is coming from. The connection string is being configured in the ODBC Admin application.

All suggestions gratefully received!

IP address of a running server

$
0
0

Microsoft released a preview of PowerBI, an authoring tool for visualizing data from a variety of databases as described here:

http://hodentek.blogspot.com/2015/02/spin-out-cutting-edge-report-with-power.html
http://hodentekmsss.blogspot.com/2015/02/authoring-report-with-power-bi-using.html

I am a Sybase enthusiast and I tested whether or not it can connect to SQL Anywhere 16(being one of the Sybase Databases). However I come up with two different kinds of errors connecting to SQL Anyhwere 16

I have started the demo16 successfully. Now I provide the server name required by PowerBI as demo16 and the database name as demo. It throws an exception as follows:

DataSource.Error: Sybase SQL Anywhere: Connection error: No IP address found for demo16
Details:
    Message=Connection error: No IP address found for demo16
    ErrorCode=-2147467259

I go back and look at the properties of the server and I find an IP Adress (NAT) of the computer on which I am running this server. If I use this information for connecting to server from PowerBI, i get a different error as follows:

DataSource.Error: Sybase SQL Anywhere: Login mode 'Integrated' not permitted by login_mode setting
Details:
    Message=Login mode 'Integrated' not permitted by login_mode setting
    ErrorCode=-2147467259

Is the IPAddress of the demo16 server the same as the local machine? Is it possible to run the demo 16 server in Windows authentication mode?

Perhaps SQL Anywhere 16 is not supported?

Viewing all 98 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>