首页 > 解决方案 > 露西执行“updateDatasource”操作时未正确存储 connectionString 属性

问题描述

我希望有人可以对这个问题有所了解。我正在尝试以编程方式将数据源添加到 Lucee 服务器上下文(即,不是基于每个应用程序,而是对服务器上的所有 Web 上下文可用的数据源)。以下对标记的调用以创建数据源或稍后更新相同的数据源会导致 connectionString 永远不会正确保存。

注意:“updateDatasource”将创建一个数据源,如果它尚不存在。

主机环境:在 OpenJDK17 上运行 Lucee 5.3.8.206 的 Windows Server 2019。

数据库环境:运行 SQL Server 2019 的 Windows Server 2019。

<cfadmin
    action="updateDatasource"
    type="server"
    password="F4K31234"
    bundlename="org.lucee.mssql"
    bundleversion="8.4.1.jre8"
    classname="com.microsoft.sqlserver.jdbc.SQLServerDriver"
    dsn="my_new_datasource"
    name="my_new_datasource"
    newName="my_new_datasource"
    connectionString="jdbc:sqlserver://SQLSERVERNAME\MSSQLSERVER2019;DATABASENAME=my_database;sendStringParametersAsUnicode=true;SelectMethod=direct"
    dbusername="Temp1234"
    dbpassword="F4K31234"
    connectionLimit="100"
    alwaysSetTimeout="true"
    validate="false"
    allowed_select="true"
    allowed_insert="true"
    allowed_update="true"
    allowed_delete="true"
    allowed_create="true"
    allowed_revoke="true"
    allowed_alter="true"
    allowed_grant="true"
    clob="true"
    lineTimeout="60">

每次尝试此操作时,连接字符串都会存储为“my_database”。换句话说,它似乎忽略了 connectionString 属性中提供的字符串,而是存储了数据源连接字符串的数据库名称。

这些设置正是我在 Lucee Server 管理区域中手动设置数据源时使用的(减去明显的假用户名、密码、服务器名称和数据库名称)。

在我开始提交错误之前,我想确保我没有在这里遗漏任何东西。我很感激任何见解!

标签: sqldatasourcecfmllucee

解决方案


推荐阅读