C# - connecting to DB2 z/os mainframe without a license - c#

Problem:
I have a c# application that requires read and write access to DB2 z/os on mainframe.
I've searched around for weeks and came up with the conclusion: either go with IBM drivers (which requires a license file, or DB2 connect, or some sort of licensed software) or go with ole DB provider for db2 (host integration server) by Microsoft.
Microsoft option is free, just need to install the drivers, no need a license file. IBM option requires a DB2 connect software and a license (even if you use the ibm nuget package, it requires you to have the license file)
Questions:
1) can I do this for free meaning no license purchase? Aside from the Microsoft option?
2) is it possible to deploy the project to a machine without having to install any drivers? (Kinda like ibm's self contained nuget package) but you know, not requiring a license file?
Thanks in advance! P.S. the DB2 server is remote, not local

IBM-provided Db2 drivers always require proper Db2 Connect licenses to access Db2 for z/OS.
Those are not always costly, this totally depends on the environment and the requirements.
Microsoft’s drivers seem to be free, however, when using them, consider:
the potential challenges when requesting the support from IBM - they will not agree to debug driver vs database interaction issues, and Microsoft will not help you unless you pay them;
possible compatibility issues, including the lack of support for the latest functions and limited compatibility with newer Db2 fixes (even within the single major Db2 version).
If those two things are not really important for you in your specific situation, you can avoid the need to pay for Db2 Connect by using Microsoft’s drivers :-)

As cschneid suggested, it IS possible to connect a c# application (or any a .NET application) to DB2 (Version 11 and up) for z/OS on mainframe through REST services. You just end up requesting and getting responses via JSON objects. You just need to make sure that DB2 is configured to handle REST calls (especially if you're using HTTPS)

Related

Is it required that postgresql is installed on every client computers when retriveing or storing data?

I need your help to answer a question.
I coded a basic c# portable exe application that uses an Access Database on a server computer. On the network there are some client computers that runs this application and retrieve and store data via this database placed on the server computer in a shared folder. Every client coputer can access my database with this connection string:
#"Provider=Microsoft.ACE.OLEDB.12.0;Data Source =\\ANKFILESERVER1\aractakip\DatabaseAd.accdb
So far, there has been no problem. But as known, Access (Oledb) database has a limited capacity to save datas and since i'm worrying that someone change or delete my database files -authenticated for everyone- i decieded to use another database platform like postgresql.
My question is, if i install postgresql on the server computer and migrate my database tables, Are every client computers needed to install postgresql to access my database tables? If yes, what should be my connection string?
Thanks in advance.
You will need a client driver - like psqlODBC - installed on each computer that connects to PostgreSQL via MS Access, yes.
You can install psqlODBC separately, or using the main PostgreSQL installer. The separate psqlODBC-only installer is an msi that can be deployed over Active Directory, making management easier.
The connection options are covered in the psqlODBC documentation.
Microsoft Access is really written for the Microsoft JET / OLEDB engine, and to communicate with Microsoft SQL Server. It works with PostgreSQL, but it doesn't fully "understand" all PostgreSQL's features. It also does some things in totally non-SQL-standard ways that work on MS SQL but do not work on PostgreSQL. So it can be awkward to use MS Access with PostgreSQL due to things like Access not really supporting SEQUENCEs properly. Note, though, that I haven't used Access since Office 2008, so things may have improved.

Good options for a MySQL Lighter version

I have a C#.NET application which connects to a MySQL database in a server.
I have a requirement to do some operations offline.( When the client machine does not have internet and cannot access the MySQL database.) My Plan is to create a MySQL database in local machine. Copy all files required to the local database and perform required operations. When the client machine have the access to the MySQL sever copy back the changed files to the server database.
My question is what are the good Options to use as local MySQL. Is there any lighter version of MySQL available?
I also need to install selected MySQL version with the windows installation package generated for my software.
Thanks in Advance.
When I have these situations I usually fall back to SqlLight. Its a simple embeddable database, and if you are using only the simplest insert /select statements you should not need to maintain much difference between your local database access vs the remote database access.
That said. If you are using something that is not that simple it's usually a good advice to bite the bullet and do the whole mySql install thing on the local machine. Because the maintenance of 2 sets of database access will eat up development time like nothing else.
In your case I would use an embedded database with your offline application, something like FireBird where you don't need to install a 3rd party database etc. The FireBird dll's are linked and part of your application deployment. http://www.firebirdsql.org/

How to connect to Hadoop/Hive from .NET

I am working on a solution where I will have a Hadoop cluster with Hive running and I want to send jobs and hive queries from a .NET application to be processed and get notified when they are done. I can't find any solutions for interfacing with Hadoop other than directly from a Java app, is there an API I can access that I am just not finding?
Apparently it is possible to connect to Hadoop with non-Java solutions - see Do I have to write my application in Java?
With Hadoop: there is no straight way to connect from C# because Hadoop communication tier is working with java only and is not cross platform. It is probably possible but in very non-trivial ways.
I know there is a patch to add Protocol Buffers support for Hadoop but at the moment of writing (Aug 2011) is is not released yet.
With Hive situation is better because Hive has Thrift interface which supports C#. You can download Hive Thrift interfaces and generate C# client on your own but beware that it requires some hacking of generated code. Instead I would recommend you downloading dll from https://bitbucket.org/vadim/hive-sharp/downloads/hive-sharp-lib.dll or use Nuget package manager, search for "hive": http://nuget.org/List/Packages/Hive.Sharp.Lib
Disclaimer: I'm the author.
There is Hortonworks ODBC driver. I havn't used it personally, but it shall let you work with hive as with any other ODBC datasource. You can use OdbcConnection class to connect to Hive once ODBC driver is installed.
As noted in other answers - you can use Thrift api. For that you need to generate C# classes from interface definition files, which you can download from Hive source repository. This approach works for me.
You can use IKVM, to convert hadoop client java libraries into .Net assemblies which you can use from C#. I havn't used IKVM with Hive client, but I've IKVMed some other hadoop client library and surprisingly it worked.
EDIT:
There's also Apache templeton, which allows submitting Hive jobs (Pig and MR also) using Rest interface. The problem with it is that it spawns another map task to submit Hive job, which makes it slower.
It is possible to access Hive utilizing C# by making use of Microsoft's ODBC connector. Download the Nuget package for "Microsoft.Hadoop.Hive" and follow the example provided at http://msdn.microsoft.com/en-us/library/dn749834.aspx
The trick lies in building the connection string to connect with it. The best way I came up with was to download the Microsoft Hive ODBC Driver (http://www.microsoft.com/en-us/download/details.aspx?id=40886), install it, then use the Server Explorer inside Visual Studio to add a new connection, then build the connection string for me. To do this, I used the following steps:
Change the data source to "Microsoft ODBC Data Source" and ensure you're using the ".NET Framework Data Provider for ODBC" as the data provider.
Under the "Data source specification" portion, check the "Use connection string" then click the "Build" button.
Under the "Machine Data Source" tab, select the "Sample Microsoft Hive DSN" data source name, then click the "OK" button.
A window titled "Microsoft Hive ODBC Driver Connection Dialog" will open. Enter an optional description, then type in the path to your Hive server, the port you will be using, and what database it should connect to. Indicate the Hive Server Type, and specify an authentication mechanism to use, then fill out the appropriate fields.
Finally, click the "Test" button in the bottom to ensure that you're able to successfully connect. If successful, click the "OK" button, then you'll be back in the "Modify Connection" window. Enter the login information for your Hive service here.
Either utilize this data source or copy the connection string that it's built for you and use it within your application.
Thrift API is also another way for other language to access hdfs and hive
See if this helps. I have tried to connect to Hadoop via C#
How to communicate to Hadoop via Hive using .NET/C#
Use Hbase.Net library from https://hbasenet.codeplex.com/
Then you can connect to hbase/hive as shown below:
Client c = new Client("10.20.14.179", 9090, 1000000);
var cli = c.TotalClients;
var tableList = c.GetTableNames();
FYI, we are using hortonworks sandbox and it connects fine.
In above example, 10.20.14.179 is host and 9090 is port.
Also, below might help from https://community.hortonworks.com/questions/25101/is-there-a-way-to-connect-to-hbase-using-c.html
There is no native C# HBase client. however, there are several options for interacting with HBase from C#.
C# HBase Thrift client - Thrift allows for defining service endpoints
and data models in a common format and using code generators to
create language specific bindings. HBase provides a Thirft server and
definitions. There are many examples online for creating a C# HBase
Thrift Client.
Marlin - Marlin is a C# client for interacting with Stargate (HBase
REST API) that ultimately became hbase-sdk-for-net. I have not
personally tested this against HBase 1.x+, but considering it uses
Stargate, I expect it should work. If you are planning to use
Stargate and implement your own client, which I would recommend over
Thrift, make sure to use protobufs to avoid the JSON serialization
overhead. Using a HTTP based approach also makes it much easier to
load balance requests over multiple gateways.
Phoenix Query Server - Phoenix is a SQL skin on HBase. Phoenix Query
Server is a REST API for submitting SQL queries to Phoenix. Here is
some example code, however, I have not yet tested it.
Simba HBase ODBC Driver - Using ODBC to connect to HBase. I've heard
positive feedback on this approach, especially from tools like
Tableau. This is not open source and requires purchasing a license.

Is there a compact or express SQL Server version that I can package with my WinForms app & is free?

Is there a light weight version of SQL Server I could use that has the characteristics of:
Free (assuming my winforms app is semi-commercial)
Can be seemlessly packaged for deployment as part of the winforms click-once application? (i.e. ease in installation for the user).
Light weight for the user (ideally something that just runs when the winforms application that uses it is running - but better than using XML sererialization for persistance).
Thanks
Yes - SQL Server Compact Edition:
Build embedded database applications for desktops and mobile devices
SQL Server Compact 3.5 is a free, easy-to-use embedded database engine that lets developers build robust Windows Desktop and mobile applications that run on all Windows platforms including Windows XP, Vista, Pocket PC, and Smartphone.
SQL Server CE is a set of DLL's you can ship included in your app.
SQL Server 2008 Express is also free, but it's a stand-alone server installation.
Marc
I don't know about any such (Microsoft) SQL server version. But if I'm in such situation I'll definitely go for SQLite or Firebird
Compact:
- you don't need to change logic of you application;
- MS Sql Management studio could be use to edit,create data structure visually ;)
- deployment, second time deployments more easy :)
SQLite:
- look in google search for the problems:), there lot of people who works with it and have problems, not form begining but during implementation "conctetical" tasks /projects
- no exists native visual interface to work with dbase (exist 3party products for that but they aren't free);
- again 2nd, 3 ... deployments needs more attention,time money :) ...
so, for me is beeter to work with MSSqlCompact, because i am working with .net kind of projects, i have to support my results, i must provide stable application etc...
Best choice is SQLite. There's ADO.NET implementation on .NET so its as easy to use as any other DB. Well, good example is Google Chrome.
There's only one unresolved issue: security. It's a pain to restrict access to SQLite database file as far as I know.

Alternative Oracle drivers for .net

I have to develop a tool in C# that retrieves some data from an Oracle DB. Since our IT support is having some trouble with installing the Oracle client, I want to be able to connect to the database without the client installed.
The idea is to just install (and maybe register) an additional library together with the app.
Which alternatives to the Oracle client exist, and what are their pros and cons?
This is for a small application (1 form, 2 or 3 queries, the result displayed in a DataGrid, probably no more than 10-20 data sets), but I am also interested in scalability issues, since we may also move away from the Oracle client with bigger future projects.
Of course a freeware solution would be nice, but we are not limited to that.
Your task can be achieved without the need of any third party software:
Install Oracle Data Access Components 11g in your development box. ODAC 11g is backwards compatible with 9i and 10g
Add a reference to the ODAC library in your .NET projects (Oracle.DataAccess.dll).
Allow your application to connect without the use of TNSNAMES.ORA. To do so, you have to include the connect descriptor in the connection string:
"user id=scott;password=tiger;data source=" +
"(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)" +
"(HOST=sales-server)(PORT=1521))(CONNECT_DATA="+
"(SERVICE_NAME=sales.us.acme.com)))"
Since you are including the connect descriptor in the connection string, the thin client is not required in the targeted computers.
Happy deployment.
There are a couple different flavors of the Oracle ODP.Net driver. Which version are you trying to use?
It sounds like you want the Oracle 11g ODAC 11.1.0.6.21 with Xcopy Deployment, which allows you to deploy the Oracle Instant Client and the ODP.Net driver just by copying a few DLLs over and registering them. That doesn't require a full-blown Oracle client installation.
Oracle currently has a version of ODP.NET that is fully managed, allowing developers to connect to Oracle databases while referencing only a single DLL. There's more information here.
Current releases can be found here.
The enterprise library client System.Data.OracleClient is a viable alternative to the ODP.NET provider from Oracle. There are severla caveats you should know though, using the Microsoft client will make it extremely difficult to work with any type of large objects whether they are XML strings, CLOBs, LOBs or BLOBs. Also the Oracle XmlType column is not supported and must be casted to a CLOB to be returned into the OracleClient.

Categories

Resources