Skip to content

Instantly share code, notes, and snippets.

@ahndmal
Last active August 20, 2024 09:41
Show Gist options
  • Save ahndmal/44ce2092c979bfa41f45985f70e71599 to your computer and use it in GitHub Desktop.
Save ahndmal/44ce2092c979bfa41f45985f70e71599 to your computer and use it in GitHub Desktop.
package com.ast.scripts.db
import groovy.sql.Sql
import org.ofbiz.core.entity.TransactionFactory
import org.ofbiz.core.entity.ConnectionFactory
import java.sql.Connection
Connection connection = TransactionFactory.getConnection("defaultDS")
Connection connection2 = ConnectionFactory.getConnection("defaultDS")
Sql sql = new Sql(connection)
String GET_EMPL_CARD_FIELD_VALUE_QUERY =
"""SELECT ID FROM AO_8C2830_EMPLOYEE_CARD where EMPLOYEE_NAME = 'a.user'"""
String value = sql.firstRow(GET_EMPL_CARD_FIELD_VALUE_QUERY)["ID"]
sql.close()
value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment