Golang DB2 error - go

I'm trying to connect to a db2 using golang using https://bitbucket.org/phiggins/db2cli. While trying to follow the instructions, I run into this error
vendor/bitbucket.org/phiggins/db2cli/api/api_unix.go:12:11: fatal
error: 'sqlcli1.h' file not found
#include <sqlcli1.h>
^~~~~~~~~~~
1 error generated.
This is the script I tried to use
#!/bin/bash
DB2HOME=$HOME/sqllib
export CGO_LDFLAGS=-L$DB2HOME/lib
export CGO_CFLAGS=-I$DB2HOME/include
go install .
Could someone point me to what I need to do to use db2cli? I'm running this code on a macbook.

To build golang with the phiggins db2cli , your workstation or server needs to have a Db2 product (e.g. a suitable client, or a server package) installed locally specifically to deliver the INCLUDE files and the library files for development with Db2.
The Db2-client software comes in different packages for different purposes, and a Db2-client also comes with a Db2-LUW server. For development purposes (i.e. to compile and link executable programs) you need the "IBM Data Server Driver package".
IBM describes the different Db2 client types at this link.
If your remote Db2-server runs on Linux/Unix/Windows, you can also try building golang-db2cli on that hostname and copy the build-targets to your workstation provided the server and workstation run the same distro and bitness and release and that the Db2 version/fixpack is identical to that of the client.
Otherwise you can download and install the relevant package from IBM's Fix Central website (registration required) , or from IBM's Passport Advantage website for registered entitled customers. The Db2-client download links are available currently at this link.

Related

Pure Perl DBI/DBD to query Oracle database

Is there the possibility of a Pure Perl DBI connection of some kind to an Oracle database? I'm trying to allow for running queries from many different servers of different architectures and avoid worrying about the specific architecture (e.g. Linux or AIX or Solaris), matching the specific installation location for the Perl modules on every server (the location of my HOME directory varies on different servers), the need to install an Oracle Instant Client on every server, and most especially, the need to do a source install of DBI and DBD::Oracle on each server.
I'm imagining something like the following:
Build and install DBI on a server (with an installed compiler) inside a local::lib environment
Build and install some kind of pure perl DBD driver (or maybe use one of the built-in DBD drivers?)
Copy only the directory structure and the .pm files to a target server
On the target server, run queries against an Oracle database using local::lib to find the modules and DBI_PUREPERL=2 to avoid the need for the .so libraries.
What kind of DBD driver would work in this scenario? JDBC or ODBC maybe?
Or should I just give up and perform a from-source installation of DBI and DBD::Oracle on sample servers of all the various architectures and then create some kind of installation package of the DBI/DBD modules + Oracle's Instant Client for the each different architecture? (Bonus points if I can avoid setting LD_LIBRARY_PATH to get Oracle's Instant Client to work.)
Thoughts?

deployed pb App transaction not connected

I have deployed a PB App created with PB12.5 Classic. Its a PB winform app. I have managed to deployed it on a test unit to test its performance. I have created a custom runtime packager.
this runtime packager that i have created consists of basic PB runtime DLL, which is the PBDWE125.dll, PBSHR125.dll PBSNC125.dll, PBVM125.dll as per sybase's instruction in infocenter.sybase.com.
i have also packaged microsoft dlls which is the atl71.dll, libjcc.dll, libjtml.dll, msvcp71.dll, msvcp100.dll, msvcr71.dll, msvcr100.dll and nlwnsck.dll.
all of these dlls are installed in C:\Program Files\Sybase\Shared\PowerBuilder.
my problem is, my PB app is running BUT WHEN I TRY TO ESTABLISH CONNECTION my database server it prompt "Transaction not Connected"
is it the PBSNC problem? i tried registering it using regsvr32 and it didnt work. i have used PB runtime packager but still no luck. i have tried the app path registry and link it to the directory stated above and still no luck...
my question is
is there anything that i can do to make this work?
win 7 has c++ runtime libraries installed already right?
what can be the cause of "transaction not connected" error
what can i do to make it work?
note:
i have user access to the database server
i can access the database server
the app is working when the PB IDE is installed
please enlighten me! thank you :D
Does the computer that the app is deployed to have the SQL Server Native Client runtime installed? (I'm assuming you're using SQL Server because you mention PBSNC125.dll.) Here's some info from a blog post I wrote a while back (I was using PB 12 and SQL Server 2008, so things may be different for you.)
Files Required
On your client machines, in addition to the PB runtimes (including PBSNC120.dll, which is for SQL Server), you also need to install the SQL Server Native Client runtime. These come as an msi installer package from Microsoft. When you install the SQL Server client, you'll need to do so as an administrator. Otherwise you'll get a cryptic error message along the lines of "0: -1".
There's a 32-bit and a 64-bit version of the runtime. The 64-bit version won't run on a 32-bit version of Windows and vice versa.
Footnote: My project used PowerBuilder Classic version 12.1 and SQL Server 2008
"Transaction not connected" usually comes from a DataWindow being given a transaction object that isn't connected to the database. It sounds like there isn't much error trapping when you connect to the database, and you're getting a down stream symptom. You need to add error checking to your CONNECT routine, and that will give you more clues as to what is going on.
One of the more common problems with connections on deployment is when programs try to read connection parameters from an INI file, and on deployment the app can't find the INI file, so with no error checking on reading the INI, the program is trying to connect with an empty transaction object and fails. However, the information you've given us is too late to have any clues whether that is the problem or not.

How to run Websphere Portal/portlets locally from within RAD to debug

I have been looking around on the internet how to setup a local Portal environment together with the RAD IDE, I found threads like this but that's a thread of the ancient history (speaking in IT terms) or only refers to optimizing Portal with RAD (here). Currently I have RAD 8.0.4.1 running and I can run a WAS-instance, but I can't manage to get the Portal-environment run locally. I read that in the past there was some sort of specific Portal Test Environment, but with the newer RAD do I have to install a full Portal? And where to get it? I cannot find a good reference anywhere.
I want to debug my portlets locally in as local Portal-context. Currently the portlets are deployed on a remote Portal-server. This costs time (package WAR, upload, refresh nodes et cetera). So I want to run our Portal locally including its portlets.
In RAD I can define new servers and can see the option "WebSphere Portal v6.1 Server on WAS 7", but it requires me to define a Server runtime environment. This opens a new popup where I have to specify:
WebSphere Portal Location
WebSphere Application Server Location
I have my runtimes installed in "IBM\SDP\runtimes" which contains the following folders "base_stub, base_v6_stub, base_v7, base_v7_stub, base_v8_stub, base_v61_stub, portal_v61_stub, updi_v7x, updi_v70, wsdk". Whatever location I try to point to, it keeps giving an error message: "The Portal Server installation is not correct".
I have the following questions:
what do I need to run/debug my portal with its portlets locally?
the fact I see portal_v61_stub in my runtime directory, means a Portal server is not installed? My IBM installation manager doesn't specifically show an option to install a Portal Server.
is it possible to run portlet/portal locally and use hotswapping to immediately see the changes in the code/view?
where can I download/install the required software?
I heard that you need a very heavy machine to do portal/debug stuff locally (I am running on a 8 GB/Intel E8400 at 3.00 GHz.)
how can I transfer the current Portal-setup which is running on a remote server to my local system (mirroring/just copy files?)
Few things,
RAD is a tool to develop application developed on Eclipse. It doesn't come with any server application. You need to install your WAS/Portal Server.
RAD supports Portal development and hence it has got stubs but you wont be able to deploy an application without a server.
what do I need to run/debug my portal with its portlets locally?
You need an Application server installed on your machine. Or Connect to a remote server.
the fact I see portal_v61_stub in my runtime directory, means a Portal server is not installed? My IBM installation manager doesn't specifically show an option to install a Portal Server.
No. Server is not installed. You dont need IBM Installation Manager for installing server. It's for RAD.
is it possible to run portlet/portal locally and use hotswapping to immediately see the changes in the code/view?
Yes it is, if you have a server installed.
where can I download/install the required software?
You can download the express version of server. But if otherwise if you are IBM business partner you can download from their website.
I heard that you need a very heavy machine to do portal/debug stuff locally (I am running on a 8 GB/Intel E8400 at 3.00 GHz.)
3 GB is fine for running RAD and IBM Websphere Portal Server. ( I am running it right now with many other applications ) But for best result use 4 GB RAM.
how can I transfer the current Portal-setup which is running on a remote server to my local system (mirroring/just copy files?)
You need to open your RAD and attach a server to it. Go to windows->preferences->servers->Webpshere

Websphere registry and repository (WSRR)

I'm trying to install WSRR on Linux (Ubuntu 11.04), but without success. I think I'm lacking some important information about installation. I've read that it's a prerequisite to have WebSphere Application Server (WAS) and DB2 installed, but when I downloaded WSRR package it has its own version of WAS and during installation it offers me Derby DB. In order to install it I had to change bash for dash (or vice versa). In the end I tried create profile of standalone WSRR in Profile Management Tool but with no success. Did anybody success in installation of standalone WSRR? Please help me, I need it for my thesis.
Thank you.
So finally I managed to install and run WSRR.
First of all you have to have OpenSuse installed.
Log in as root
Reinstall you web browser (I changed mozilla 4 to mozilla 6)
Launch installation ./launchpad.sh
Create profile with Profile Management Tool GUI
Run First steps console => change directory to profile_root/firststeps/wsrr, for example, opt/IBM/WebSphere/ServiceRegistry/profiles/WSRRSrv01/firststeps/wsrr and ./launchpad.sh
Run server
Start the WSRR Web UI (if you have stand-alone server)
Not a final answer... it seems you're installing on an unsupported platform. Never try this with commercial software, you will fail or will need hours and hours to get it up and running.

Cognos 8.3 failing to connect to data source. Why?

I have installed Cognos BI 8.3 on my machine, which has a Windows 7 OS 64-bit. In IBM's supported environment list for Cognos 8.3, Windows 7 is not listed. On top of that, it says the product will only integrate with 32-bit 3rd party libraries. So, you can already see that I'm already starting on a bad foot. But anyways, this is the machine I have and that is the software I got, so I decided to see if they would work together..
I installed Oracle 10g Express database also in my machine and Apache 2.2 server. Up to there no problems.
Before moving further, I copied ojdbc14.jar to cognos/.../webapps/p2pd/WEB-INF/lib and added the Oracle database in Cognos Configuration. Tested, passed.
With the database started, the Apache server started, and Cognos started, I was successfully able to start Cognos Connection on the computer. So, it looks like the OS is not an issue.
(You can see everything I did by following the steps on this site, which since two days ago seems to be down but I'm thinking will eventually come back up)
Then I decided to try the samples, so I tried to create a data source connection from Cognos to the Oracle database. So, in the admin config console (i.e. Administer Cognos Contents > Configuration), I decided to create a new Oracle data source. I put the credentials, but BAM.. testing fails.
Fail Message:
QE-DEF-0285 The logon failed.
QE-DEF-0323 The DSN(ODBC)/ServiceName is invalid. Either the DSN is missing or the host is inaccessible.
RQP-DEF-0068 Unable to connect to at least one database during a multi-database attach to 1 database(s) in:
testDateSourceConnection
UDA-SQL-0031 Unable to access the "testDataSourceConnection" database.
UDA-SQL-0532 Data Source is not accessible: "XE".
ORA-12154: TNS:could not resolve the connect identifier specified
RSV-SRV-0042 Trace back:
...
From what I have researched, it could be a number of things, but nothing seems to work. Here is what I tried:
Adding ODBC driver. Added the Oracle XE driver, even making sure it was done in the 32-bit ODBC manager (i.e. Windows\SysWOW64\odbcad32.exe). That didn't work.
Added ORACLE_HOME, LD_LIBRARY_PATH, and TNS_ADMIN to my environment variables.
tnsping'ed the XE database and it the ping returned ok.
There are no tnsnames.ora duplicates in the computer.
I tried and I am able to connect to the database via sqlplus. Did I mention that Cognos Config database test also passed?
Installed Oracle XE client. But didn't do much with it because the Oracle server is installed in the computer and also has a client component.
Has anyone come across this problem? I haven't been able to diagnose the problem or make even the slight progress for days. If you would like me to provide more information on any of the solutions I tried, please do ask. If you have a potential solution or, even better, if you have been able to solve this problem before, please let me know how!
Thanks!
One thing to keep in mind : certain portions of Cognos BI are implemented via Java and other portions are implemented via native C++ processes (the BI Bus processes)
Cognos connects to the content store database from the Java process using JDBC.
The BI Bus processes will connect to Oracle using a native oracle client.
So based on your description, I'd say that the problem area is in the native oracle client configuration (or the Cognos service's perspective of it).
You mentioned adding the ORACLE_HOME, LD_LIBRARY_PATH, and TNS_ADMIN environment variables in windows, and the fact that Oracle Utilities like SQLPlus and TNSPing are working for you.
When you added the environment variables, did you add them to the SYSTEM area for environment variables or the User area...?
If you're running Cognos as a service, its going to be a child process of SERVICES.EXE, which is run as system (this process is also not restarted unless you reboot the machine).
I'd try this :
make sure the above environment variables are defined for the SYSTEM user (in the system area, not the user area)
once you've done this, reboot the machine
See if you can create the database connection now.
If that doesn't work, I'd suggest doing a "run as" of SQLPlus or TNSPING as the SYSTEM user (and see if that works).
In order to use oracle as data source, you must install 32 bit client.
64 bit client will not work.
So if you installed oracle express 64 bit, and you don't want to uninstall it,
you can just install additional 32 bit client, and make sure to set it as your default home.

Resources