Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

M-Biz 6.7 Client / Ultralite 11 reOpenConnection() method

3 posts in General Discussion Last posting was on 2009-02-23 09:28:25.0Z
Shao Chan Posted on 2009-02-20 16:14:26.0Z
Reply-To: "Shao Chan" <noreply@noreply.com>
From: "Shao Chan" <noreply@noreply.com>
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: M-Biz 6.7 Client / Ultralite 11 reOpenConnection() method
Lines: 50
Organization: Civica
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <499ed6e2@forums-1-dub>
Date: 20 Feb 2009 08:14:26 -0800
X-Trace: forums-1-dub 1235146466 10.22.241.152 (20 Feb 2009 08:14:26 -0800)
X-Original-Trace: 20 Feb 2009 08:14:26 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1336
Article PK: 9377

Hi all,

Has anyone got the reOpenConnection() method to work for M-Biz?
http://dcx.sybase.com/index.php#http%3A%2F%2Fdcx.sybase.com%2F1100en%2Fulmbus_en11%2Fag-apiref-s-4871272.html

There is a lack of examples, but I am unable to get it working.

Let's say we create a database:

dbMgr.createDatabase("dbf=" + dbMgr.directory +
"\\mobileServitor.udb;UID=dba;PWD=sql", Collation_UTF8BIN, "");
conn = dbMgr.openConnection("dbf=" + dbMgr.directory +
"\\mobileServitor.udb;UID=dba;PWD=sql");
// OPTION A: conn = dbMgr.openConnection("con=" + connectionName + "dbf=" +
dbMgr.directory + "\\mobileServitor.udb;UID=dba;PWD=sql");
// OPTION B: conn = dbMgr.openConnection("con=" + connectionName);

qry = "ALTER DATABASE SCHEMA FROM FILE '"+ dbMgr.directory +
"\\mobileServitor.sql'";
qryStmt = conn.prepareStatement(qry, null);
qryStmt.executeStatement();

In the above example, when I create the connection (conn), I cannot supply
con=<connectionName>. Otherwise it errors. The connection I use connects
directly to the database by supplying the database path.

If I use the commented OPTION A, I also add in the connection name.
However, this will error saying it can't find the database.

If I use the commented OPTION B assuming that dbMgr is smart enough now to
know its created a database, it also does not work and says it can't find
the database.

Therefore, if I am not able to supply a Connection Name, how is it possible
to call reOpenConnection() later and supply a Connection Name if it cannot
be assigned in the first place?

I tried to find a property that I might set after conn has been initialised,
but I also can't find any reference that allows me to do this.

How do I make use of Connection Names with reOpenConnection() in Ultralite
11 with M-Biz?

Cheers,

Shao


"Chris Keating [Sybase iAnywhere]" <keating_no Posted on 2009-02-20 17:04:53.0Z
From: "Chris Keating [Sybase iAnywhere]" <keating_no@spam_sybase.com>
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: M-Biz 6.7 Client / Ultralite 11 reOpenConnection() method
References: <499ed6e2@forums-1-dub>
In-Reply-To: <499ed6e2@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <499ee2b5$1@forums-1-dub>
Date: 20 Feb 2009 09:04:53 -0800
X-Trace: forums-1-dub 1235149493 10.22.241.152 (20 Feb 2009 09:04:53 -0800)
X-Original-Trace: 20 Feb 2009 09:04:53 -0800, vip152.sybase.com
Lines: 65
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1337
Article PK: 17953

The tutorial shows an example usage of this technique. See

UltraLite - M-Business Anywhere Programming »
Tutorial: A sample application for M-Business Anywhere »
Lesson 4: Add startup code to your application

Can you verify the connection parm string to verify that it is valid
i.e.

alert( "con=" + connectionName )

or hardcode the connectionName value to see if that changes the
behaviour (as in the tutorial example).

Shao Chan wrote:
> Hi all,
>
> Has anyone got the reOpenConnection() method to work for M-Biz?
> http://dcx.sybase.com/index.php#http%3A%2F%2Fdcx.sybase.com%2F1100en%2Fulmbus_en11%2Fag-apiref-s-4871272.html
>
> There is a lack of examples, but I am unable to get it working.
>
> Let's say we create a database:
>
> dbMgr.createDatabase("dbf=" + dbMgr.directory +
> "\\mobileServitor.udb;UID=dba;PWD=sql", Collation_UTF8BIN, "");
> conn = dbMgr.openConnection("dbf=" + dbMgr.directory +
> "\\mobileServitor.udb;UID=dba;PWD=sql");
> // OPTION A: conn = dbMgr.openConnection("con=" + connectionName + "dbf=" +
> dbMgr.directory + "\\mobileServitor.udb;UID=dba;PWD=sql");
> // OPTION B: conn = dbMgr.openConnection("con=" + connectionName);
>
> qry = "ALTER DATABASE SCHEMA FROM FILE '"+ dbMgr.directory +
> "\\mobileServitor.sql'";
> qryStmt = conn.prepareStatement(qry, null);
> qryStmt.executeStatement();
>
> In the above example, when I create the connection (conn), I cannot supply
> con=<connectionName>. Otherwise it errors. The connection I use connects
> directly to the database by supplying the database path.
>
> If I use the commented OPTION A, I also add in the connection name.
> However, this will error saying it can't find the database.
>
> If I use the commented OPTION B assuming that dbMgr is smart enough now to
> know its created a database, it also does not work and says it can't find
> the database.
>
> Therefore, if I am not able to supply a Connection Name, how is it possible
> to call reOpenConnection() later and supply a Connection Name if it cannot
> be assigned in the first place?
>
> I tried to find a property that I might set after conn has been initialised,
> but I also can't find any reference that allows me to do this.
>
> How do I make use of Connection Names with reOpenConnection() in Ultralite
> 11 with M-Biz?
>
> Cheers,
>
> Shao
>
>
>
>


Shao Chan Posted on 2009-02-23 09:28:25.0Z
Reply-To: "Shao Chan" <noreply@noreply.com>
From: "Shao Chan" <noreply@noreply.com>
Newsgroups: ianywhere.public.mbusinessanywhere.general
References: <499ed6e2@forums-1-dub> <499ee2b5$1@forums-1-dub>
Subject: Re: M-Biz 6.7 Client / Ultralite 11 reOpenConnection() method
Lines: 77
Organization: Civica
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49a26c39@forums-1-dub>
Date: 23 Feb 2009 01:28:25 -0800
X-Trace: forums-1-dub 1235381305 10.22.241.152 (23 Feb 2009 01:28:25 -0800)
X-Original-Trace: 23 Feb 2009 01:28:25 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1340
Article PK: 9378

Hi Chris,

Thanks for that! :)

Cheers,

Shao

"Chris Keating [Sybase iAnywhere]" <keating_no@spam_sybase.com> wrote in
message news:499ee2b5$1@forums-1-dub...
> The tutorial shows an example usage of this technique. See
>
> UltraLite - M-Business Anywhere Programming »
> Tutorial: A sample application for M-Business Anywhere »
> Lesson 4: Add startup code to your application
>
> Can you verify the connection parm string to verify that it is valid
> i.e.
>
> alert( "con=" + connectionName )
>
> or hardcode the connectionName value to see if that changes the behaviour
> (as in the tutorial example).
>
> Shao Chan wrote:
>> Hi all,
>>
>> Has anyone got the reOpenConnection() method to work for M-Biz?
>> http://dcx.sybase.com/index.php#http%3A%2F%2Fdcx.sybase.com%2F1100en%2Fulmbus_en11%2Fag-apiref-s-4871272.html
>>
>> There is a lack of examples, but I am unable to get it working.
>>
>> Let's say we create a database:
>>
>> dbMgr.createDatabase("dbf=" + dbMgr.directory +
>> "\\mobileServitor.udb;UID=dba;PWD=sql", Collation_UTF8BIN, "");
>> conn = dbMgr.openConnection("dbf=" + dbMgr.directory +
>> "\\mobileServitor.udb;UID=dba;PWD=sql");
>> // OPTION A: conn = dbMgr.openConnection("con=" + connectionName + "dbf="
>> + dbMgr.directory + "\\mobileServitor.udb;UID=dba;PWD=sql");
>> // OPTION B: conn = dbMgr.openConnection("con=" + connectionName);
>>
>> qry = "ALTER DATABASE SCHEMA FROM FILE '"+ dbMgr.directory +
>> "\\mobileServitor.sql'";
>> qryStmt = conn.prepareStatement(qry, null);
>> qryStmt.executeStatement();
>>
>> In the above example, when I create the connection (conn), I cannot
>> supply con=<connectionName>. Otherwise it errors. The connection I use
>> connects directly to the database by supplying the database path.
>>
>> If I use the commented OPTION A, I also add in the connection name.
>> However, this will error saying it can't find the database.
>>
>> If I use the commented OPTION B assuming that dbMgr is smart enough now
>> to know its created a database, it also does not work and says it can't
>> find the database.
>>
>> Therefore, if I am not able to supply a Connection Name, how is it
>> possible to call reOpenConnection() later and supply a Connection Name if
>> it cannot be assigned in the first place?
>>
>> I tried to find a property that I might set after conn has been
>> initialised, but I also can't find any reference that allows me to do
>> this.
>>
>> How do I make use of Connection Names with reOpenConnection() in
>> Ultralite 11 with M-Biz?
>>
>> Cheers,
>>
>> Shao
>>
>>
>>