Tibco BW SQL Direct Activity. Is it possible to run multiple statements? - jdbc

I use Tibco Business Works 5.14.
I am trying to run multiple SQL statements in one "SQL Direct" activity.
Tried with Oracle (ojdbc7_12.1.0.2.jar) and MySQL(mysql-connector-java-5.1.47.jar) jdbc drivers with no luck.
Example statements:
I see similar question in tibco community forum but no clear answer https://community-dev.tibco.com/questions/multiple-statements-sql-direct-activity
Is it possible to run multiple SQL statements using "SQL Direct Activity" in tibco BW5 ?

I have found the answer:
Running multiple statements in "SQL Direct" activity problem is not related to Tibco "Direct SQL" Activity itself. it's more related to jdbc driver implementation and database settings. 
Please see Multiple queries executed in java in single statement
for running multiple statements for example in MySQL you need to add 
?allowMultiQueries=true
 to connection string
String dbUrl = "jdbc:mysql:///test?allowMultiQueries=true";
Please note that setting ?allowMultiQueries=true also making your query vulnerable to various "SQL Injection" issues. Please see example SQL injection on INSERT

Related

How to restrict Apache Zeppelin JDBC Interpreter to only select queries

I am doing POC for Apache Zeppelin for reporting purpose. I created a JDBC Interpreter to connect Oracle database. This way our user can execute queries and generate reports. Currently they have to login through toad to fetch data/report every day. We must restrict that.
But problem is, they can also execute update/delete queries. I want our user to run the Select queries and not any DML queries or Inserts.
Is there a way to restrict it? I expected some setting in configuration,
I tried to look on their documentation but couldn't find any clue.

view sql generated by WSO2 DSS service

We have a very large SQL statement in our WSO2 DSS service which is executing a query against an Oracle database. With some parameters the query works. With others it fails and the Oracle error indicates there is a missing right ")" in the SQL statement. How can we see the actual SQL being sent to Oracle when the DSS executes. We've tried enabling DEBUG on any relevant looking logger and no luck.
You need to turn debug level in you DSS/Configure/Logging for
org.wso2.carbon.dataservices.core.description.query.SQLQuery
Then in Monitor/System Logs - you can see queries that was called and it's exceptions.
You can use log4jdbc to log every jdbc query that goes from DSS to Oracle. Here is a tutorial you can follow.

Require tool to trace the LInq Queries in Oracle

i am working entity framework with oracle data connection.
Can anyone suggest tool to get the LINQ queries executed in oracle.
I am looking similar tools like SQL profile in Oracle to trace and execute the queries.
I'm not aware of such a tool, but if you are using Entity Framework 6 and you can modify the application code, you can trace the queries by using the builtin logging.
For example, to output all queries to the console, you can use:
context.Database.Log = Console.Write;
For more details check https://msdn.microsoft.com/en-us/data/dn469464.aspx.

How do I set the SDE version in SSIS dataflow source

I have a GIS oracle database and I am needing to reference in a SSIS dataflow task. Ideally I would normally do something like this (which works perfectly in Oracle SQL Developer):
execute sde.version_util.set_current_version('SAFE.mvedits')
SELECT CAD_EVENTID
FROM SAFE.INCIDENT_POINT_MV
however when I try to use that as the SQL command of my OLE DB Datasource it throws me an "Invalid SQL" error.
How do I set the SDE version in a SSIS dataflow task data source?
Knowing nothing of nothing on Oracle, what you might try is
In your Oracle Connection Manager, change the property RetainSameConnection to True. This means that all connections will Oracle will use the same thread.
Add an Execute SQL Task before your Data Flow that talks to Oracle. Use your query there to modify the current version thing. This setting should be persisted on the connection.
In your OLE DB Datasource, start with the SELECT statement.
You might need to set DelayValidation to true as well.
If that's not working, let me know and I'll see if I can come up with anything else.
As it turns out this is a shortfall of interacting with GIS Oracle databases through thirdparty applications. In my situation we addressed it by just bundling the change up in a stored procedure that lives on the oracle server and invoking that stored procedure from inside SSIS.

Setting connection info using XQJ with Oracle 11g

I am trying to submit XQuery queries to an Oracle 11g database through their XQJ API.
When I instantiate an oracle.xquery.xqj.OXQDataSource as explained in http://www.oracle.com/technetwork/articles/oem/xquery-jdbc-325944.html, I can submit queries fine except that I haven't found how I can set up the server connection (server name, port, username, password, ...) info:
This datasource claims that it doesn't support setting any property.
It doesn't implement the data source constructor which takes a JDBC connection.
I don't see any non standard method to set such info.
When I try to access some random collection like collection("oradb:/foo") I just get an empty result set even when no server is running, suggesting that the driver doesn't even try to connect.
What have I missed and how can I set the server connection info?
Thanks,
Eric
Thanks to Charles Foster I can answer to my own question: the XQJ implementation from Oracle is an old standalone version from January 2010 that is pretty useless and doesn't interact with Oracle databases.
Despite all the Oracle statements about XQJ, I haven't been able to find any client/server XQJ implementation (except one from DataDirect of course) and the way to submit XQuery queries to Oracle databases appears to be through JDBC, embedded in PL-SQL statements.
It is possible in 12.
XQJ to run queries in Java:
http://docs.oracle.com/database/121/ADXDK/adx_j_xqj.htm#ADXDK99930
XQJ to run queries against the database:
http://docs.oracle.com/database/121/ADXDK/adx_j_xqjxdb.htm#ADXDK136

Resources