When trying to connect to Microsoft Azure from an external source I get the following error: - sql

When trying to connect to Microsoft Azure from an external application source (SNAPPII) I get the following error:
I am using an XML template as supplied by SNAPPII tech support but they are unable to pinpoint the issue.
Can anyone help pinpoint the issue?
Error during query execution. Try to check the Data Source Configuartion.
Error : ERROR [42000] [Microsoft][SQL Server Native Client 10.0][SQL Server]Reference to database and/or server name in ‘ODBC.dbo.TableName’ is not supported in this version of SQL Server
I have enclosed a code for xml file below.
I believe this type of connection should work with Microsoft Azure databases but to be honest I am a complete newbie in this environment.
<ext_db_settings>
<connection_strings>
<connection_string name="foreland"><![CDATA[Driver={SQL Server Native Client 10.0}; Server=tcp:ianm.database.windows.net; Database=foreland; Uid=ian.marks#ianm; Pwd=xxxxx; Encrypt=yes;]]></connection_string>
</connection_strings>
<query command="select" connection_string_name="foreland" type="sql" cache_timeout="0" max_size="5">
<body><![CDATA[
SELECT *
FROM [ODBC].[dbo].[TableName]
]]></body>
</query>
<query command="add" connection_string_name="foreland" type="sql">
<body><![CDATA[
INSERT INTO [TableName]
(
Id,
Name,
Age,
Residence
)
VALUES
(
'[set.Id]',
'[set.Name]',
'[set.Age]',
'[set.Residence]'
)
]]></body>
</query>

Related

create sequence via ucanaccess

I have some troubles creating a sequence in a MS Access database via Dbeaver / ucanaccess connector.
Does anybody know, if this should be possible or is not implemented?
The error I get is the following:
org.jkiss.dbeaver.model.sql.DBSQLException: SQL-Fehler: UCAExc:::5.0.1 net.ucanaccess.jdbc.FeatureNotSupportedException: Feature not supported yet.
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:133)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:577)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$1(SQLQueryJob.java:486)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:172)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:493)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:894)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:3645)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:123)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:172)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:121)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:4949)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Unable to connect to Google BigQuery using Mule

I am trying to connect to BigQuery for migrating data and I am currently facing some issues in connection.
2 approaches which I am currently focusing on
Database Connector with passing JDBC connection string
<db:config name="Database_Config" doc:name="Database Config" doc:id="07671c43-86bc-4768-b914-c71058120615" >
<db:generic-connection url="jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=<project-id>;OAuthType=0;OAuthPvtKeyPath=<path-to-key-file>;OAuthServiceAcctEmail=<email>" driverClassName="com.simba.googlebigquery.jdbc42.Driver"/>
</db:config>
The above results in an error when testing connection
ToolingException{message='Got status code: 500 when trying to
resolve a Mule Runtime operation. Reason: 'Server Error.
{"errorType":null,"errorMessage":null,"errorDetail":null,"additionalProperties":{servlet=org.glassfish.jersey.servlet.ServletContainer-7bf5036,
message=Request failed.,
url=/mule/tooling/applications/4cfe61fc-a304-4ee5-8b52-36ed6e4cfd66/components/Database_Config/connection,
status=500}}'' , rootCauseMessage='null' , rootCauseType='null'
, rootCauseStackTrace='[]'} at
org.mule.tooling.client.api.exception.ToolingException$Builder.build(ToolingException.java:141)
at
org.mule.tooling.agent.rest.client.RestAgentToolingService.handleToolingAgentHandlerException(RestAgentToolingService.java:911)
at
org.mule.tooling.agent.rest.client.RestAgentToolingService.lambda$serviceExceptionOrToolingException$43(RestAgentToolingService.java:859)
at
org.mule.tooling.agent.rest.client.RestAgentToolingService.serviceExceptionOr(RestAgentToolingService.java:873)
BigQuery Connector provided by MuleSoft
<bigquery:config name="BigQuery__Configuration" doc:name="BigQuery Configuration" doc:id="3b8287ed-f3e5-4721-bd9e-96950347cf3a" >
<bigquery:jwt-connection privateKeyId="<private-key-id>" privateKey="<private-key>" issuer="<email>" projectId="<project-id>" />
</bigquery:config>
The above results in an error
org.mule.runtime.api.connection.ConnectionException: Could not
create connection Caused by:
org.mule.runtime.api.exception.MuleRuntimeException: Invalid PKCS8
data.
I made sure the credentials passed are appropriate and we also checked with the customer regarding appropriate privileges to use this but still did not find a way to solve this.
References
mulesoft-bigquery-jdbc

Access violation at address 04FD6CC2 in module 'dbxora.dll'. Read of address 00000004

I have created DELPHI database application which will use DBX TSQLConnection component to connect to Oracle database (19c version).
I'm getting access violation error , When i call oracle listagg function (SQLQuery1.open --in this line).
When i debugged , i got the error in below object file,
FileName : Data.DBXDynalink.pas
Function : function TDBXDynalinkReader.DerivedNext: Boolean;
Error Line : DBXResult := FMethodTable.FDBXReader_Next(FReaderHandle);
Actual Error : Access violation at address 04FD6CC2 in module 'dbxora.dll'. Read of address 00000004
Below is my code ,
...SQLQuery1 initialization....
SQLQuery1.CommandText := Trim(memoSQLText.Lines.Text); // Assigning query
SQLQuery1.Open; // Exactly on this line i'm getting error
if SQLQuery1.RecordCount > 0 then
....Do something here....
Note : Same query is executing in other versions which are all below to Oracle version 19C (19.3)
IDE version used for application development : DELPHI XE3 (i have checked with DELPHI 10.1 Berlin also)
DB version : Oracle 19C (19.3)
Steps to reproduce :
// 1.Execute below queries in order to create testing data ,
create table myuserlist(myuser varchar2(10));
Insert into myuserlist(myuser) values('karthik');
Insert into myuserlist(myuser) values('aarush');
Insert into myuserlist(myuser) values('yuvan');
// 2.Try to open the below mentioned query using TSQLConnection and TSQLQuery
select listagg(a.myuser, ', ') within group (order by a.myuser) as myusernames from myuserlist a
Sample project is available in the GitHub,
https://github.com/yuvankarthik/DELPHI-DemoOracleConnect.git
Help me to resolve this issue.

MS SQL JDBC error on Execution exception - Invalid object name [Play 2.x scala app]

I'm using Play framework 2.x with SQL driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
I'm trying to run a simple query:
SELECT [org].[name] FROM [ref].[organisations_bak] AS org
but I get the following error:
play.api.Application$$anon$1: Execution exception[[SQLServerException: Invalid object name 'ref.organisations_bak'.]]
at play.api.Application$class.handleError(Application.scala:293) ~[play_2.10-2.2.2.jar:2.2.2]
at play.api.DefaultApplication.handleError(Application.scala:399) [play_2.10-2.2.2.jar:2.2.2]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:165) [play_2.10-2.2.2.jar:2.2.2]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$12$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:162) [play_2.10-2.2.2.jar:2.2.2]
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) [scala-library-2.10.3.jar:na]
at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:185) [scala-library-2.10.3.jar:na]
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ref.organisations_bak'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) ~[sqljdbc4-4.0.2206.100.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) ~[sqljdbc4-4.0.2206.100.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792) ~[sqljdbc4-4.0.2206.100.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689) ~[sqljdbc4-4.0.2206.100.jar:na]
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) ~[sqljdbc4-4.0.2206.100.jar:na]
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) ~[sqljdbc4-4.0.2206.100.jar:na]
I need to use the schema reference in my queries but I cant even get a simple query like this to work on my play app, simple queries without schema references work fine
SELECT name FROM organisations_bak
My Scala code looks like this:
import java.sql.ResultSet
import play.api.db.DB
DB.withConnection {
conn =>
val res = conn.createStatement.execute("SELECT [org].[name] FROM [ref].[organisations_bak] AS org")
}
Any help would be appreciated.
Thanks
In my case the issue was different user permissions. The server I used for development has been setup in some weird way that my user didn't have the permission to access the [ref] schema.
Just as a test I switched over to an AWS RDS SQL Server instance with the default DBA (owner) user settings and everything worked.
This means that the library and the code works it's my server that's at fault, but that's another issue.
try using
SELECT [org].[name] FROM [ref].[dbo].[organisations_bak] AS org

Deploying worklight project on WAS 8.5

I got the following exception when i deployed the war on WAS 8.5
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityAssociationCleanupTask' defined in URL [wsjar:file:/C:/Program%20Files/IBM/Worklight/WorklightServer/worklight-jee-library.jar!/conf/core.xml]: Invocation of init method failed; nested exception is org.springframework.orm.jpa.JpaSystemException: "WRKSCHM.CLUSTER_SYNC" is an undefined name.. SQLCODE=-204, SQLSTATE=42704, DRIVER=3.57.82 {prepstmnt -234009374 SELECT t0.HOSTVMID, t0.ID, t0.UPDATETIMESTAMP, t0.VERSION FROM WRKSCHM.CLUSTER_SYNC t0 WHERE t0.ID = ? optimize for 1 row [params=(String) identityAssociationCleanupTask]} [code=-204, state=42704]SQLCA OUTPUT[Errp=SQLNQ1FC, Errd=-2145779603, 0, 0, 0, -10, 0]
"WRKSCHM.CLUSTER_SYNC" is an undefined name.. SQLCODE=-204, SQLSTATE=42704, DRIVER=3.57.82
An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-204", SQLSTATE "42704" and message tokens "WRKSCHM.CLUSTER_SYNC".. SQLCODE=-727, SQLSTATE=56098, DRIVER=3.57.82
An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-204", SQLSTATE "42704" and message tokens "WRKSCHM.CLUSTER_SYNC".. SQLCODE=-727, SQLSTATE=56098, DRIVER=3.57.82; nested exception is <openjpa-1.2.2-r422266:898935 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: "WRKSCHM.CLUSTER_SYNC" is an undefined name.. SQLCODE=-204, SQLSTATE=42704, DRIVER=3.57.82 {prepstmnt -234009374 SELECT t0.HOSTVMID, t0.ID, t0.UPDATETIMESTAMP, t0.VERSION FROM WRKSCHM.CLUSTER_SYNC t0 WHERE t0.ID = ? optimize for 1 row [params=(String) identityAssociationCleanupTask]} [code=-204, state=42704]SQLCA OUTPUT[Errp=SQLNQ1FC, Errd=-2145779603, 0, 0, 0, -10, 0]
"WRKSCHM.CLUSTER_SYNC" is an undefined name.. SQLCODE=-204, SQLSTATE=42704, DRIVER=3.57.82
An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-204", SQLSTATE "42704" and message tokens "WRKSCHM.CLUSTER_SYNC".. SQLCODE=-727, SQLSTATE=56098, DRIVER=3.57.82
An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE "-204", SQLSTATE "42704" and message tokens "WRKSCHM.CLUSTER_SYNC".. SQLCODE=-727, SQLSTATE=56098, DRIVER=3.57.82
But I am able to deploy the same on the embedded server of eclipse.
And iam not able to see any internal tables under APPCNTR database.
Iam using worklight 6.0 and i installed using installation manager 1.6.3.
Iam using DB2 10.1,I have manually created APPCNTR,WRKLGHT,WLREPORT databases and set the schemas for WRKLGHT as WRKSCHM and WLREPORT as WLRESCHM.
I followed this http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fdeploy%2Fc_deploy_custom_war_file_to_app_server.html, for Configuring WebSphere Application Server for DB2 manually.
followed http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fdeploy%2Fc_deploy_custom_war_file_to_app_server.html this to Configuring WebSphere Application Server manually and deploying .
Please help me if I have missed any configuration.
You have not provided details about your environment (Worklight version, WAS profile, database) so it is difficult to pinpoint exactly what the problem could be; my answer is based on certain assumptions, such as that you are using DB2.
Looking closely to the error:
WRKSCHM is the schema name that Worklight Server is trying to access through JPA
CLUSTER_SYNC is a table in the 'WRKLGHT' database
This error can be caused by either the table not being properly created (DB2 setup process is incomplete), or by a schema name mismatch (WAS datasource setup incorrect).
Please verify the following on your environment:
DB2 Setup
Make sure that your DB2 is properly configured for Worklight; verify that the necessary databases are created ('WRKLGHT' for Worklight Server, 'WLREPORT' for the Worklight Reports feature and 'APPCNTR' for Worklight Application Center). The following documentation might be useful to you:
Creating the DB2 databases
Setting up the 'WRKLGHT' and 'WLREPORT' databases
Setting up the 'APPCNTR' database
DB2 Schema Configuration
Make sure that your WAS configuration is properly defining the appropriate schema name that you used in the steps above; the schema name is passed to the JDBC driver using the currentSchema property. The following documentation might be helpful as well:
Configuring DB2 on WAS Liberty profile
Configuring DB2 on WAS Standard profile
DB2 Cheat Sheet (how to list the current DB2 schema names)
DB2 schema qualifiers
I hope this will help you get past this problem.