All Apps and Add-ons

serviceClass for AS400 and jt400.jar [as400.access.AS400JDBCDriver]

israelgutierrez
Path Finder

Hello

I'm trying to connect to a DB2 Database using Database Connect v2 with a personalize stanza in splunk:
/etc/deployment-apps/splunk_app_db_connect/local/db_connection_types.conf

With these configs:

[db2400]
displayName = DB2 on OS400
jdbcDriverClass = com.ibm.as400.access.AS400JDBCDriver
jdbcUrlFormat = jdbc:as400://<host>;translate binary=true
testQuery = SELECT CURRENT USER FROM SYSIBM.SYSDUMMY1
port = 8471
maxConnLifetimeMillis = 500000

But I miss the serviceClass Configuration I try to use the following:
serviceClass = com.splunk.dbx2.DB2JDBC

But appears an error with the message saying that the com.ibm.as400.access.AS400JDBCDriver is not present, but that driver is present in jt400.jar which is in the /etc/deployment-apps/splunk_app_db_connect/bin/lib directory installed correctly

Thanks

0 Karma

Rjaramillom
Engager

Utiliza esta configuración. Me funciono.
En el archivo "db_connection_types.conf" que esta ubicada en la ruta de instalación del App en mi caso es {/opt/splunk/etc/apps/splunk_app_db_connect/default}

[AS400]
displayName = DB2 on OS400
serviceClass = com.splunk.dbx2.DB2JDBC
jdbcDriverClass = com.ibm.as400.access.AS400JDBCDriver
jdbcUrlFormat = jdbc:as400:;prompt=false

testQuery = VALUES 1
port = 8471
maxConnLifetimeMillis = 500000
alt text

En la configuración de la conexión del App se crea utilizando el tipo de Base de Datos que se adiciono.
alt text

Para traer los Datos lo haces por el Query en la forma avanzada. Digitando la instrucción SQL que deseas.
Ej. SELECT * My_Lib.My_File

israelgutierrez
Path Finder

Following with the case:

I'm trying these configuration:

[db2as400I]
displayName = DB2 on OS400I
serviceClass = com.splunk.dbx2.DB2JDBC
jdbcDriverClass = com.ibm.as400.access.AS400JDBCDriver
jdbcUrlFormat = jdbc:as400://<host>:<port>/<database>;translate binary=true
testQuery = SELECT CURRENT USER FROM SYSIBM.SYSDUMMY1
port = 8471
maxConnLifetimeMillis = 500000


[OS400I]
connection_type = db2as400I
database = PENSDAT
host = 10.200.65.253
identity = SQLServer
port = 8471

The error about the Driver disappear but now the error is around a Headless exception:

Validating connection with URL [jdbc:as400://10.200.65.253:8471/PENSDAT;translate binary=true] failed: java.awt.HeadlessException:java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Changing the start parameter with
-Xmx2048m -XX:+UseConcMarkSweepGC -Djava.awt.headless=true

The error now is:

Validating connection with URL [jdbc:as400://10.200.65.253:8471;translate binary=true] failed: java.awt.HeadlessException:java.awt.HeadlessException

0 Karma

araitz
Splunk Employee
Splunk Employee

I think that it would require some work on our side to implement some Java code. Feel free to put in an enhancement request for OS400I with support.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...