× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I use the following code: Just change to JDK60.

* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* GetConnection
* This function gets a connection to Sql Server database
* Input - None
* Out - None
* Returns - None
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
p GetConnection...
p b
d pi

d cJDK_Home...
d c 'ADDENVVAR ENVVAR(JAVA_HOME)
VALUE(+
d ''/QOpenSys/QIBM/ProdData/+
d JavaVM/jdk50/32bit'')'

d cJAVA_LocalConnection...
d c 'ADDENVVAR ENVVAR(+
d QIBM_RPG_JAVA_PROPERTIES) VALUE(+
d ''-Djdbc.db2.restricted.local.+
d connection.only=true;'')'

d MyProperty...
d s Like(Properties)
/Free

Monitor;
ExecuteSystemCommand(cJDK_HOME);
On-Error;
EndMon;
Monitor;
ExecuteSystemCommand(cJAVA_LocalConnection);
On-Error;
EndMon;

MyProperty = JDBC_Properties();
If MyProperty = *Null;
ERRH_Throw('CPF9898' :
cCPFMessageFileName :
'Unable to create property object');
EndIf;

JDBC_SetProp(MyProperty: 'user' : %Trim('TMTPMUSER'));
JDBC_SetProp(MyProperty: 'password' : %Trim('cactus99'));
JDBC_SetProp(MyProperty: 'databaseName': 'TMT_DEV');

// Uses Open Source JTDS Java Driver. Much faster.
g_Connection = JDBC_ConnProp('net.sourceforge.jtds.jdbc.Driver' :
'jdbc:jtds:sqlserver://CRE-TMT:1433':
MyProperty );

JDBC_FreeProp(MyProperty);

If g_Connection = *Null;
ERRH_Throw('CPF9898' :
cCPFMessageFileName :
'Unable to open connection to TMT_DEV');
EndIf;

Return;

/End-Free
p e


On Wed, Feb 20, 2013 at 3:36 PM, Pete Helgren <pete@xxxxxxxxxx> wrote:

There was just a thread on this on Midrange-L (around the 13th)

WRKENVVAR QIBM_RPG_JAVA_PROPERTIES

I wasn't following the thread closely but you can set the JVM version
there (I think).

java.version=1.6 ?

Pete Helgren
www.petesworkshop.com
GIAC Secure Software Programmer-Java

On 2/20/2013 4:21 PM, James H. H. Lampert wrote:
I tried running the programs in batch, so that the STDOUT/STDERR output
would go to a spool file, where it wouldn't instantly scroll of my
screen, and so that I'd get detailed joblogs (and so I wouldn't have to
sign off and sign back on after each unsuccessful attempt.

I think I may have spotted something:

/QOpenSys/QIBM/ProdData/JavaVM/jdk50/32bit

Could it possibly be that this needs to run under Java 6?

If so, how do I specify that for JDBCR4?

--
JHHL

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.