SGS16 Trusted Contributor.
Trusted Contributor.
2499 views

How to connect to Database activity in Hpoo?

Jump to solution

Hi,

  Can  anyone tell How to connect to Oracle database and and run the query in HP operation Orchestration ? which activity to use.What are the Parameters we need to pass?

 

Thanks and Regards,

sgs

Labels (1)
0 Likes
1 Solution

Accepted Solutions
SGS16 Trusted Contributor.
Trusted Contributor.

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hi ,

  Thank you all for your..My issue is resolved..i didn't enable the Port 1521...now its olved.

Thanks and Regards,

SGS16

 

0 Likes
11 Replies
SGS16 Trusted Contributor.
Trusted Contributor.

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hi ,

while connecting to database am getting this error

Error:

java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection

0 Likes
EASJosh Respected Contributor.
Respected Contributor.

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hi SG,

Are you using the Databases content pack to run this flow, which is available here?

Cheers,
Josh


--------------------------------------
If my post helped you, please click the 'Kudos' button.
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hi,

The message you receive sounds like a network connectivity issue between the db and the server where OO is installed. This in turn may be caused by firewalls between the 2 hosts, dns issues (fqdn vs ips, or ips from different networks, multiadapters) and in some cases even by the DB itself (postgresql have some settings which have to be set in order to allow connections from other hosts, mysql needs to have separate users for localhost and remote hosts).  

Whitout further information we cannot reliably help you solve your issue, however the points above may guide you in the right direction to troubleshoot your environment.

Regards,

Vlad

0 Likes
EASJosh Respected Contributor.
Respected Contributor.

Re: How to connect to Database activity in Hpoo?

Jump to solution

Agreed with Vlad, may be an idea if it's allowed to disable the firewall to ensure this is not the issue (of course, temporarily for testing purposes and not to be turned off indefinitely).

If you could test all advice given, and if it's still failing, give more information on the whole scenario and the inputs you're using.

Cheers,
Josh


--------------------------------------
If my post helped you, please click the 'Kudos' button.
0 Likes
SGS16 Trusted Contributor.
Trusted Contributor.

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hi all,

  I am giving the below Paaremter;

Hostname:

Username for host:

Password for host:

Dbname:

Port:1521

command : 

  I am  using the above parameters am  getting the below errors:

 exception=java.lang.ArrayIndexOutOfBoundsException: 50
at oracle.net.jdbc.nl.NLParamParser.initializeNlpa(Unknown Source)
at oracle.net.jdbc.nl.NLParamParser.<init>(Unknown Source)
at oracle.net.resolver.TNSNamesNamingAdapter.loadFile(TNSNamesNamingAdapter.java:168)
at oracle.net.resolver.TNSNamesNamingAdapter.checkAndReload(TNSNamesNamingAdapter.java:242)
at oracle.net.resolver.TNSNamesNamingAdapter.resolve(TNSNamesNamingAdapter.java:112)
at oracle.net.resolver.NameResolver.resolveName(NameResolver.java:163)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:416)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:687)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:247)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.iconclude.content.actions.sql.dbconnection.DBConnectionManager.getPlainConnection(DBConnectionManager.java:549)
at com.iconclude.content.actions.sql.dbconnection.DBConnectionManager.getConnection(DBConnectionManager.java:216)
at com.iconclude.content.actions.sql.services.ConnectionService.obtainConnection(ConnectionService.java:140)
at com.iconclude.content.actions.sql.services.ConnectionService.setUpConnection(ConnectionService.java:111)
at com.iconclude.content.actions.sql.services.SQLQueryService.executeSqlQuery(SQLQueryService.java:26)
at com.iconclude.content.actions.sql.TNSNamesSQLQuery.execute(TNSNamesSQLQuery.java:162)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.hp.oo.sdk.plugins.abstracts.BaseActionPlugin.execute(BaseActionPlugin.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.hp.oo.maven.PluginAdapterImpl.executePlugin(PluginAdapterImpl.java:328)
at com.hp.oo.maven.PluginAdapterImpl.execute(PluginAdapterImpl.java:248)
at com.hp.oo.execution.control.actions.contentexecution.ContentExecutionActions.executeContentAction(ContentExecutionActions.java:97)
at sun.reflect.GeneratedMethodAccessor788.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at io.cloudslang.worker.execution.reflection.ReflectionAdapterImpl.executeControlAction(ReflectionAdapterImpl.java:62)
at io.cloudslang.worker.execution.services.ExecutionServiceImpl.executeStep(ExecutionServiceImpl.java:326)
at io.cloudslang.worker.execution.services.ExecutionServiceImpl.execute(ExecutionServiceImpl.java:80)
at io.cloudslang.worker.management.services.SimpleExecutionRunnable.executeRegularStep(SimpleExecutionRunnable.java:167)
at io.cloudslang.worker.management.services.SimpleExecutionRunnable.run(SimpleExecutionRunnable.java:120)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at io.cloudslang.worker.management.services.WorkerThreadFactory$1.run(WorkerThreadFactory.java:33)
at java.lang.Thread.run(Thread.java:745)
;returnCode=-1;rowsLeft=0;returnResult=50;sessionId=;Result=50;}

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hi, 

I try the following inputs:

hostname: db hostname/ip

username: db admin username (ex: sys/system) or db username 

password: password for above user

DBname: SID of the oracle db

port: 1521

And for command the command you want to execute. If you are using the jdbc operations from databases folder in base content pack also provide the dbType input as oracle.

 

Hope this helps,

Vlad

0 Likes
SGS16 Trusted Contributor.
Trusted Contributor.

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hi ,

  I have tried that also but gets the same error . Database is in the same machine where oo is studio is installed.

 

exception=java.lang.ArrayIndexOutOfBoundsException: 50
at oracle.net.jdbc.nl.NLParamParser.initializeNlpa(Unknown Source)
at oracle.net.jdbc.nl.NLParamParser.<init>(Unknown Source)
at oracle.net.resolver.TNSNamesNamingAdapter.loadFile(TNSNamesNamingAdapter.java:168)
at oracle.net.resolver.TNSNamesNamingAdapter.checkAndReload(TNSNamesNamingAdapter.java:242)
at oracle.net.resolver.TNSNamesNamingAdapter.resolve(TNSNamesNamingAdapter.java:112)
at oracle.net.resolver.NameResolver.resolveName(NameResolver.java:163)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:416)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:687)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:247)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.iconclude.content.actions.sql.dbconnection.DBConnectionManager.getPlainConnection(DBConnectionManager.java:549)
at com.iconclude.content.actions.sql.dbconnection.DBConnectionManager.getConnection(DBConnectionManager.java:216)
at com.iconclude.content.actions.sql.services.ConnectionService.obtainConnection(ConnectionService.java:140)
at com.iconclude.content.actions.sql.services.ConnectionService.setUpConnection(ConnectionService.java:111)
at com.iconclude.content.actions.sql.services.SQLCommandService.executeSqlCommand(SQLCommandService.java:24)
at com.iconclude.content.actions.sql.SQLCommand.execute(SQLCommand.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.hp.oo.sdk.plugins.abstracts.BaseActionPlugin.execute(BaseActionPlugin.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.hp.oo.maven.PluginAdapterImpl.executePlugin(PluginAdapterImpl.java:328)
at com.hp.oo.maven.PluginAdapterImpl.execute(PluginAdapterImpl.java:248)
at com.hp.oo.execution.control.actions.contentexecution.ContentExecutionActions.executeContentAction(ContentExecutionActions.java:97)
at sun.reflect.GeneratedMethodAccessor788.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at io.cloudslang.worker.execution.reflection.ReflectionAdapterImpl.executeControlAction(ReflectionAdapterImpl.java:62)
at io.cloudslang.worker.execution.services.ExecutionServiceImpl.executeStep(ExecutionServiceImpl.java:326)
at io.cloudslang.worker.execution.services.ExecutionServiceImpl.execute(ExecutionServiceImpl.java:80)
at io.cloudslang.worker.management.services.SimpleExecutionRunnable.executeRegularStep(SimpleExecutionRunnable.java:167)
at io.cloudslang.worker.management.services.SimpleExecutionRunnable.run(SimpleExecutionRunnable.java:120)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at io.cloudslang.worker.management.services.WorkerThreadFactory$1.run(WorkerThreadFactory.java:33)
at java.lang.Thread.run(Thread.java:745)
;returnCode=-1;returnResult=50;sessionId=;Result=50;}

 

Thanks and Regards,

SGS

 

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hi,

After doing a bit more research it seems that there is a problem with the oracle tnsnames.ora file that cause the jdbc connection to fail.  See the following articles on the subject (maybe one of them holds the solution to your problem):

https://community.oracle.com/thread/3955598

https://ronkitay.wordpress.com/2013/05/27/arrayindexoutofboundsexception-when-creating-a-connection-to-an-oracle-database/

http://stackoverflow.com/questions/5902150/java-lang-arrayindexoutofboundsexception-when-creating-a-connection-to-an-oracle

Hope this helps,

Vlad

 

mostafa_hassan Outstanding Contributor.
Outstanding Contributor.

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hello, 

I agree with Vlad, That's Ora listner for db , below Some Hints to check your settings, that's if Oracle on linux.

ORACLE TShoot :

[oracle@xxxx admin]$ pwd
/home/oracle/app/oracle/product/11.2.0/client_1/network/admin
[oracle@xxxx admin]$ ll
total 32
drwxr-xr-x 2 oracle oracle 4096 Jul 7 2011 samples
-rw-r--r-- 1 oracle oracle 187 May 9 2007 shrept.lst
-rw-r--r-- 1 oracle oracle 228 Jul 7 2011 sqlnet.ora
-rw-r--r-- 1 oracle oracle 652 Oct 15 2012 tnsnames.ora
[oracle@xxxxxxx admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/client_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

CMDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Hostname1)(PORT = 1523))
)
(CONNECT_DATA =
(SERVICE_NAME = CMDB)
)
)

SM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Hostname2)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = Hostname3)(PORT = 1522))
)
(FAILOVER = ON)
(LOAD_BALANCE = OFF)
(CONNECT_DATA =
(SERVICE_NAME = SM)
)
)

Regards
Mostafa Hassan
--------------------------------------
If my post helped you, kindly click the 'Kudos' button.
mostafa_hassan Outstanding Contributor.
Outstanding Contributor.

Re: How to connect to Database activity in Hpoo?

Jump to solution

Also forget you can test DB instanse for service listner using, tnsping <SERVICE_NAME>

 

Regards
Mostafa Hassan
--------------------------------------
If my post helped you, kindly click the 'Kudos' button.
0 Likes
SGS16 Trusted Contributor.
Trusted Contributor.

Re: How to connect to Database activity in Hpoo?

Jump to solution

Hi ,

  Thank you all for your..My issue is resolved..i didn't enable the Port 1521...now its olved.

Thanks and Regards,

SGS16

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.