Console View:
[2014-01-22 21:53:47] Starting adapter deployment on Worklight Server
[2014-01-22 21:53:47] Starting build of adapter: trial
[2014-01-22 21:53:47] Adapter deployment failed: Failed updating platform version in adapter XML file C:\Users\admin\AppData\Local\Temp\AdapterBuilderTask34474\trial.xml
trial.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed Materials - Property of IBM
5725-G92 (C) Copyright IBM Corp. 2011, 2013. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
-->
<wl:adapter name="trial"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wl="http://www.worklight.com/integration"
xmlns:sql="http://www.worklight.com/integration/sql">
<displayName>trial</displayName>
<description>trial</description>
<connectivity>
<connectionPolicy xsi:type="sql:SQLConnectionPolicy">
<!-- Example for using a JNDI data source, replace with actual data source name -->
<!-- <dataSourceJNDIName>java:/data-source-jndi-name</dataSourceJNDIName> -- >
<!-- Example for using MySQL connector, do not forget to put the MySQL connector library in the project's lib folder -->
<dataSourceDefinition>
<driverClass>com.mysql.jdbc.Driver</driverClass>
<url>jdbc:mysql://localhost:3306/IBM</url>
<user>root</user>
<password>root</password>
</dataSourceDefinition>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="5" />
</connectivity>
<!-- Replace this with appropriate procedures -->
<procedure name="procedure1"/>
<procedure name="procedure2"/>
</wl:adapter>
试impl.js
/*
* Licensed Materials - Property of IBM
* 5725-G92 (C) Copyright IBM Corp. 2011, 2013. All Rights Reserved.
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
/************************************************************************
* Implementation code for procedure - 'procedure1'
*
*
* @return - invocationResult
*/
var procedure1Statement = WL.Server.createSQLStatement("select COLUMN1, COLUMN2 from TABLE1 where COLUMN3 = ?");
function procedure1(param) {
return WL.Server.invokeSQLStatement({
preparedStatement : procedure1Statement,
parameters : [param]
});
}
/************************************************************************
* Implementation code for procedure - 'procedure2'
*
*
* @return - invocationResult
*/
function procedure2(param) {
return WL.Server.invokeSQLStoredProcedure({
procedure : "storedProcedure2",
parameters : [param]
});
}
我是worklight工作室的新手。我创建了一个新的Sql适配器并将Jar连接器文件添加到项目的bin文件夹中。 我在trial.xml文件中进行了必要的更改。部署适配器导致错误。 我对适配器进行了简短的研究,但目前还没有解决方案。任何帮助将不胜感激。
答案 0 :(得分:0)
根据提供的信息,XML声明似乎很好,唯一似乎是关闭的是复制JDBC连接器驱动程序的位置。
根据入门模块"SQL Adapter - Communicating with SQL database":
开发人员必须单独下载特定数据库类型的JDBC连接器驱动程序,并将其添加到Worklight项目的 server / lib / 文件夹中。
请提供适配器JavaScript文件的副本,以便社区对可能出错的内容进行全面分析。