Highlighted
Contributor.
Contributor.
349 views

JNDI Datasource - Visual COBOL Eclipse 4.0

Jump to solution

Hi,

I have created a JNDI Datasource within a Java Class and want to pass the object to Managed COBOL as my understanding is that you can connect using 'EXEC SQL CONNECT TO Datasource object' according to the documentation. 

However when the EXEC SQL CONNECT statement is run I get  'Connection datasource not found' within MFSQLMESSAGETEXT.

If I get the connection object from the datasource within my Java class I can pass the connection object to my COBOL JVM wrapper and connect using 'EXEC SQL BIND'.  I have been told that using BIND as in the example within the docs can be slow so wanted to try the JNDI option. 

Has anyone used this approach? I have tried using the SQL(JNDI) setting but no joy.

Would be much appreciated if anyone could provide me with some pointers.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: JNDI Datasource - Visual COBOL Eclipse 4.0

Jump to solution

The EXEC SQL BIND is the method to use if your connection object already exists. EXEC SQL CONNECT TO will try to create a new connection using the jndi description that is setup in your environment.

From where did you get the impression that the BIND was slow? Is this your impression after testing with it?

 

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: JNDI Datasource - Visual COBOL Eclipse 4.0

Jump to solution

The EXEC SQL BIND is the method to use if your connection object already exists. EXEC SQL CONNECT TO will try to create a new connection using the jndi description that is setup in your environment.

From where did you get the impression that the BIND was slow? Is this your impression after testing with it?

 

View solution in original post

0 Likes
Highlighted
Contributor.
Contributor.

Re: JNDI Datasource - Visual COBOL Eclipse 4.0

Jump to solution

Thanks Chris,

The connection object will already exist from the pool so the BIND option works for me. I have not noticed any performance issues with the BIND statement, it was mentioned in a discussion I had regarding JDBC with JVM COBOL and SQL Server.

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.