Skip to content

Commit

Permalink
v1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcGueury committed Dec 7, 2023
1 parent d776a91 commit 85b5d7f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

public class HelloFunction {

{%- if db_family != "none" %}
private final String dbUser = System.getenv().get("DB_USER");
private final String dbPassword = System.getenv().get("DB_PASSWORD");
private final String dbUrl = System.getenv().get("DB_URL");
{%- endif %}

{%- if db_family == "oracle" %}
{%- if db_family == "oracle" %}
final static String CONN_FACTORY_CLASS_NAME = "oracle.jdbc.pool.OracleDataSource";
private PoolDataSource poolDataSource;

Expand All @@ -38,6 +40,16 @@ public HelloFunction() {}
{%- endif %}

public String handleRequest(String input) {
{%- if db_family == "none" %}
return """
[
{ "deptno": "10", "dname": "ACCOUNTING", "loc": "Seoul"},
{ "deptno": "20", "dname": "RESEARCH", "loc": "Cape Town"},
{ "deptno": "30", "dname": "SALES", "loc": "Brussels"},
{ "deptno": "40", "dname": "OPERATIONS", "loc": "San Francisco"}
]
""";
{%- else %}
// System.out.println("dbUser=" + dbUser + " / dbPassword=" + dbPassword + " / dbUurl=" + dbUrl);
int counter = 0;
StringBuffer sb = new StringBuffer();
Expand Down Expand Up @@ -68,5 +80,6 @@ public String handleRequest(String input) {
}
sb.append("]");
return sb.toString();
{%- endif %}
}
}

This file was deleted.

5 changes: 2 additions & 3 deletions option/src/app/fn/fn_node_psql/func.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ fdk.handle(async function() {
rejectUnauthorized: false
}
})
const [rows, fields] = await pool.query("SELECT deptno, dname, loc FROM dept");
connection.end();
return rows.rows;
response = await pool.query("SELECT deptno, dname, loc FROM dept");
return response.rows;
})

0 comments on commit 85b5d7f

Please sign in to comment.