System performOnServer: - LDAP - MySQL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

System performOnServer: - LDAP - MySQL

BrunoBB
Hi All,

I was able to connect to LDAP and MySQL using System performOnServer:.
You have to install ldapsearch and mysql command in the same machine GemStone is.

LDAP 1 (with authentication):
System performOnServer:
'ldapsearch -x -D "cn=admin.myApp,C=UY" -H ldap://10.245.50.147 -b "ou=users,cn=myApp-test,C=UY" -w ldappassword'.

-D is the connection name for -w ldappassword
-H is the ip address
-b is the start route of the search in LDAP

This answer a string with all LDAP users under -b option, in this case "ou=users,cn=myApp-test,C=UY".

LDAP 2:
System performOnServer:
'ldapcompare -x -D "cn=admin.myApp,C=UY" -H ldap://10.245.50.147  "uid=myUserID,ou=usuarios,cn=myApp-test,C=UY" -w ldappassword userpassword:myPwdInLdapServer'.

Answer True if the password in LDAP server of user "myUserID" is equal to myPwdInLdapServer otherwise answer false.

MySQL1:
System performOnServer:  
'mysql -h 10.215.152.125 -u root -pMySQLPasswordForRoot -e "show databases"' .

Answer a string with all databases name

MySQL2:
System performOnServer:
 'mysql -h 10.215.152.125 -u root -pMySQLPasswordForRoot -e "select xml from orbeon.orbeon_form_definition where form=''denuncias''" '

Answer the correct data from MySQL.

The only problem is that the amount of space memory to get the result string is limited. If the sql sentence answer a big string the an error arise that Temp memory is short.

Error message in Jade:
Fatal GemStone Error
VM temporary object memory is full, old space overflow

Regards,
Bruno
Reply | Threaded
Open this post in threaded view
|

Re: System performOnServer: - LDAP - MySQL

BrunoBB
Error message in Jade:
Fatal GemStone Error
VM temporary object memory is full, old space overflow

This problem can be solved if we put the result string in a file in the server. Then we can process this file.

System performOnServer:
'mysql -h 10.225.231.10 -u root -pmysql -B -e "select * from orbeon.orbeon_form_definition" > /home/mySqlResult.txt '

A > at the end of Linux will redirect the output to a file. (myLongLinuxCommand > /home/mySqlResult.txt)

Regards,
Bruni