Go to: community.gemstone.com | www.gemstone.com
All times are UTC - 8 hours [ DST ]
 
Post new topic Reply to topic  [ 8 posts ] 

connect to SQLFabric from DB2 client (DRDA protocol)

Post by So » Thu Sep 17, 2009 2:56 am
Posts: 16
Joined: Thu Sep 17, 2009 2:15 am
Location: Tokyo, Japan
Offline  Profile  
Hello, SQLFabric guys.
I think that SQLFabric is a great product and it will be able to make big market.

Now, I tried to connect to SQLFabric alpha3 from DB2 client but I couldn't.

I had already read
http://community.gemstone.com/display/s ... ng+ADO.NET
but I guess this procedure is older version.
Alpha3 doesn't have com.gemstone.sqlfabric.internal.drda.NetworkServerControl class and some arguments seems to be different.
It'll help me and other SQLFabric users if you update this instruction page.

I had already read these articles.
http://www.ibm.com/developerworks/data/ ... 409kartha/
http://www.ibm.com/developerworks/data/ ... MP=GENSITE
Yes, connecting to derby was easy for me.
Moreover, I guess that I have to know default DataBase name of SQLFabric to connect from DB2 client if the way of connecting to SQLFabric is same as Derby...

Best Regards,
So

Re: connect to SQLFabric from DB2 client (DRDA protocol)

Post by David Brown » Fri Sep 25, 2009 11:31 am
GemStone Employee
GemStone Employee
Posts: 76
Joined: Tue Jul 28, 2009 4:56 pm
Offline  Profile  
Nakamura-san,
We also found some connectivity issues with the alpha 3 version, and have corrected them in alpha 4 (available from our download site now).

For your benefit, and for anyone else in the community, Yagihashi-san has written a simple, Visual Studio based example for a C++ client connecting to SQL Fabric (attached). This example should work after following the configuration example documented at http://community.gemstone.com/display/sqlfabric/Using+ADO.NET

Our apologies for the inconvenience.

Attachments:
sqlfsample.zip [4.43 KiB]
Downloaded 109 times

_________________
David R. Brown
Chief Architect, US West, Federal and AsiaPac
VMware Inc., SpringSource Division
brownd at vmware.com

Re: connect to SQLFabric from DB2 client (DRDA protocol)

Post by So » Mon Sep 28, 2009 12:46 am
Posts: 16
Joined: Thu Sep 17, 2009 2:15 am
Location: Tokyo, Japan
Offline  Profile  
David-san,

Thanks for your reply.
After I downloaded alpha4, I could connect to SQLFabric from DB2 client by DB2's Command Line Processor. But I had to add username to 'APP' and password to 'APP' in connecting process.
I couldn't connect to SQLFabric if there are no username or password.

Connecting from C# app Yagihashi-san made wasn't fine under my test.
I got some errors...well, let me explain.

The following error I got first:
Quote:
SQL30020N Execution of the command or SQL statement failed because of a
syntax error in the communication data stream that will affect the successful
execution of subsequent commands and SQL statements: Reason Code
"0x124C"("011D")"". SQLSTATE=58009


I added user and password to C# example code.
Code:
connStringBld.UserID = "app";
connStringBld.Password = "app";

Then, I got different error message.
Quote:
SQL30082N Attempt to establish connection failed with security reason "17" ("UNSUPPORTED FUNCTION"). SQLSTATE=08001


I used Visual C# 2008 Express Edition. I guess this limited edition may be one of reasons of errors...
I did all tests under Windows XP Professional (x86). SQLFabric and C# application run on the same machine.
SQLFabric server was run by 'sqlf fabricserver start'. '-noSecurityManager' was treated as invalid argument in alpha4 (and alpha3).

Thank you for updating some wiki pages. It helped us.
This report will also help you to enhance this great product.

Best Regards,
So

Re: connect to SQLFabric from DB2 client (DRDA protocol)

Post by Jags » Mon Sep 28, 2009 9:31 am
GemStone Employee
GemStone Employee
Posts: 13
Joined: Tue Jul 28, 2009 3:56 pm
Offline  Profile  
Note that the Network control is started automatically when a 'fabricserver' is launched in Alhpa4. So, there is no reason to use start the Network control explicitly as defined in the wiki page. The server listens for client (edge) connections on port 1527 by default.
The ADO.NET wiki page is out of date. We will get this corrected today.

_________________
Bubba Jags

Re: connect to SQLFabric from DB2 client (DRDA protocol)

Post by So » Wed Sep 30, 2009 1:12 am
Posts: 16
Joined: Thu Sep 17, 2009 2:15 am
Location: Tokyo, Japan
Offline  Profile  
Jags-san, thanks for your cooperation.

And I have a good news that I solved my original issue which is how to connect to SQLFabric from C# application.

The following codes are part of original examples.
Code:
            DB2ConnectionStringBuilder connStringBld = new DB2ConnectionStringBuilder();
            connStringBld.Server = "localhost:1527";
            connStringBld.Database = "sqlfabric";

            // Establishing a client session to SQLFabric
            conn = new DB2Connection(connStringBld.ConnectionString);
            conn.Open();

As I wrote before, I got error messages.
As a result of the trial and error, I added some parameters like the following.
Code:
            DB2ConnectionStringBuilder connStringBld = new DB2ConnectionStringBuilder();
            connStringBld.Server = "localhost:1527";
            connStringBld.Database = "sqlfabric";
            connStringBld.Authentication = "server";  // I added
            connStringBld.UserID = "app";  // I added
            connStringBld.Password = "app";  // I added

            // Establishing a client session to SQLFabric
            conn = new DB2Connection(connStringBld.ConnectionString);
            conn.Open();

There were no errors and it generated one table and inserted 100 records!
Authentication was a key parameter.

I'm happy if this is good report for you.

Best Regards,
So

Re: connect to SQLFabric from DB2 client (DRDA protocol)

Post by So » Thu Nov 26, 2009 6:49 pm
Posts: 16
Joined: Thu Sep 17, 2009 2:15 am
Location: Tokyo, Japan
Offline  Profile  
Hi,

I have similar errors in Alpha5.

Well, would you tell me a formal instruction for connecting by ADO.NET?

Attached zip is printed screen of our errors.
1: set SQLF address and DB name (same as Yagihashi-san's sample)-> error
2: added authentication -> password required
3: added username and password without authentication -> unsupported function
4: added all param(username, password, authentication) -> NullReference

Of course, I confirmed that JDBC connection worked fine.

Best Regards,
So

Attachments:
File comment: error details
screens.zip [316.66 KiB]
Downloaded 95 times
Last edited by So on Fri Nov 27, 2009 6:17 am, edited 1 time in total.

Re: connect to SQLFabric from DB2 client (DRDA protocol)

Post by So » Thu Nov 26, 2009 10:29 pm
Posts: 16
Joined: Thu Sep 17, 2009 2:15 am
Location: Tokyo, Japan
Offline  Profile  
I god it.
Internal derby version in alpha5 is reset.
DB2connection instance couldn't be created due to this change.

Would you fix it as soon as possible you can?
As you know, our project is short period.

Best Regards,
So

Attachments:
File comment: differences between a4 and a5
a4_vs_a5.zip [199.62 KiB]
Downloaded 99 times
Last edited by So on Fri Nov 27, 2009 6:18 am, edited 1 time in total.

Re: connect to SQLFabric from DB2 client (DRDA protocol)

Post by So » Fri Nov 27, 2009 3:28 am
Posts: 16
Joined: Thu Sep 17, 2009 2:15 am
Location: Tokyo, Japan
Offline  Profile  
Hi,
This is an additional information.
I confirmed that connecting from VB6 worked fine.

The following is sample.
Code:
Sub Main()

Dim strSQL As String
Dim conn As New ADODB.Connection
Dim adoRst As New ADODB.Recordset

conn.Open "driver={IBM db2 odbc DRIVER};Database=SAMPLE;hostname=192.168.XX.YY;port=1527;protocol=TCPIP;uid=app;pwd=app;authentication=server"
strSQL = "select count(*) as tables from sys.systables"

adoRst.CursorLocation = adUseClient
adoRst.Open strSQL, conn, adOpenStatic, adLockReadOnly, adCmdText

Debug.Print adoRst.Fields("tables")
End Sub


This information might have demand.

Best Regards,
So

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours [ DST ]

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
[ Delete all board cookies ] [ The team ]