使用更新的Oracle JDBC驱动程序和密码中的特殊字符执行报告时出错

2020-08-14 07:47发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中) 简短的问题 升级到较新的J...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


简短的问题

升级到较新的JDBC驱动程序版本后,我们的一个测试用例显示了一个错误。 该测试用例模拟了一个oracle用户的报表执行情况,该用户的密码中包含特殊字符(请参见下面的测试用例)。

Oracle错误是"无效的Oracle URL",因此我猜"连接字符串"不正确/特殊字符需要某种转义或其他任何形式。

任何帮助都会很棒!

谢谢。 再见彼得

版本

crjava运行时版本12.2.225

Oracle JDBC版本19.3(不起作用)

Oracle JDBC版本12.1.0.2(正在运行)

测试用例

ReportExecutor类只是在执行报告之前替换登录信息,就像Java示例中一样(JRCHelper-> ConnectionInfo.setUserName和setPassword ...)

公共类_OracleJDBCTest {

 私有最终字符串LIEFNR =" 90310062";
 私人最终String PASSWORD ="paßwört!";

  //为测试用户设置带有特殊字符的密码
   @之前
   公共无效setUp()引发异常{
     最后的DmlOperation createUser =新的DmlOperation(" ALTER USER" + LOGIN_USER_NN +" ID \\"" +密码+" \"");
     P4Platform.getDatabaseService()。execute(createUser,true);
   }

   @后
   public void tearDown()引发异常{
     最后的DmlOperation createUser = new DmlOperation(" ALTER USER" + LOGIN_USER_NN +" IDENTIFIED BY \" phoenix \"");
     P4Platform.getDatabaseService()。execute(createUser,true);
   }

   @测试
   公共无效testCrystalLoginWithSpecialCharacterInOraclePassword()
     引发ReportSDKException,IOException,SQLException {

   最终的ILoginData serverLoginData = P4Platform.getDatabaseService()。getLoginData();
   最后的LoginData loginData =新的LoginData(LOGIN_USER_NN,PASSWORD,serverLoginData.getServerUri(),
 空值);

   试试(最终ReportExecutor reportExecutor = new ReportExecutor(P4Platform.getDatabaseService(),loginData))
   {
     最终Map 参数= new HashMap <>();
     params.put(" LIEFNR",LIEFNR);
     params.put(" VARIANTE"," 0");
     最终Map  crystalParams = Collections.singletonMap(" FRM_LS_POS.LS_LIEFNR",LIEFNR);
     assertNotNull(reportExecutor.open(" FRM_LS",params,crystalParams));
     assertNotNull(reportExecutor.execute());
   }
  }
 } 

错误

com.crystaldecisions.sdk.occa.report.lib.ReportSDKException:Fehler bei der Anmeldung:UngültigeOracle-URL angegeben ----错误代码:-2147467259错误代码名称:com.crystaldecisions.sdk.occa失败。 com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:148)处的report.application.PrintOutputController.if(SourceFile:238)com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:148) com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:112)位于com.godyo.p5.crystal.ReportExecutor.execute(ReportExecutor.java:93)位于com.godyo.p5 .datasource.jdbc._OracleJDBCTest.testCrystalLoginWithSpecialCharacterInOraclePassword(_OracleJDBCTest.java:56)位于sun.reflect.NativeMethodAccessorImpl.invoke0(本地方法)位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)位于sun.reflect。 (DelegatingMethodAccessorImpl.java:43)在java.lang.re 在org.junit.runners.model.FrameworkMethod $ 1.runReflectiveCall(FrameworkMethod.java:50)处的flect.Method.invoke(Method.java:498)在org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java) :12)在org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)在org.junit.internal.runners.statement.org.junit.internal上爆炸(FrameworkMethod.java:47) org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)的Runners.statements.RunBefores.evaluate(RunBefores.java:26)org.junit.runners.ParentRunner.runLeaf(ParentRunner.java: 325),位于org.junit.runners.ParentRunner $ 3.run(ParentRunner.3)(位于org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)的org.junit.runners.BlockJUnit4ClassRunner.java:57处。 java:290)org.junit.runners.ParentRunner $ 1.schedule(ParentRunner.java:71)org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)org.junit.runners.Pa 在org.junit.runners.rentent的rentRunner.access $ 000(ParentRunner.java:58)在org.eclipse的org.junit.runners.ParentRunner.run(ParentRunner.java:363)的$ 2.evaluate(ParentRunner.java:268) org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)上的.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)在org.eclipse.jdt.internal上 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)上的.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)在org.eclipse.jdt.internal.junit.runner上 org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)上的.RemoteTestRunner.run(RemoteTestRunner.java:382)在org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run (CoreTestApplication.java:23)在sun.reflect.NativeMethodAccessorImpl.invoke0(自然方法)在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)在sun.reflect.DelegatingMethodA 在org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)处的java.lang.reflect.Method.invoke(Method.java:498)处的ccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)上的.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) 位于org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)的org.eclipse.core.runtime.adaptor.EclipseStarter.run的.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) (EclipseStarter.java:235)在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) org.eclipse.equinox.launcher.Main.invokeFr上的java.lang.reflect.Method.invoke(Method.java:498) org.eclipse.equinox.launcher上的amework(Main.java:669)org.eclipse.Mainino.basinoRun.Main.run(Main.java:1515)上的org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) .equinox.launcher.Main.main(Main.java:1488)原因:com.crystaldecisions.reports.common.QueryEngineException:Fehler bei der Anmeldung:在com.crystaldecisions.reports.queryengine.Connection.a上取消Oracle-URL Angegeben (SourceFile:1876)位于com.crystaldecisions.reports.queryengine.Connection.bs(SourceFile:1815)位于com.crystaldecisions.reports.queryengine.Connection.bv(SourceFile:505)位于com.crystaldecisions.reports.queryengine.Connection。 uj(SourceFile:3020)位于com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.a(SourceFile:697)位于com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.for com.crystaldecisions.reports com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.long(SourceFile:962)处的com.businessobjects.reports.sdk处的.reportdefinition.ReportHelper.a(SourceFile:198) com上com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:677)处com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1943)处的.requesthandler.ReportViewingRequestHandler.a(SourceFile:640)。 com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)上的business.objects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)$ 2.a(SourceFile:528) com.businessobjects.reports.sdk.JRCCommunicationAdapter $ 2.call(SourceFile:525)位于com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)位于com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524) ),位于com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)处,位于com.businessobjects.sdk.erom.jrc.aa的com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)处 54)在com.cr上的com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67) ystaldecisions.proxy.remoteagent.RemoteAgent $ a.execute(SourceFile:716)在com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)在com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537) 在com.crystaldecisions.sdk.occa.report.application.dt.a(SourceFile:186)在com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)在com.crystaldecisions.sdk.occa .report.application.ReportSource.a(SourceFile:337),位于com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:224)... 49更多原因:com.businessobjects.reports.jdbinterface。 DBException:常见问题:在com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCConnection.Open(未知源)的com.crystaldecisions.reports.com上的Oracle-URL语言。 JDBConnectionWrapper.Open(SourceFile:123)位于 com.crystaldecisions.reports.queryengine.Connection.bs (来源文件:1786)...另外75个原因:java.sql.SQLException:取消对Oracle-URL angegeben的 oracle.jdbc.driver.PhysicalConnection.readConnectionProperties(PhysicalConnection.java:1035)上的oracle.jdbc.driver.PhysicalConnection.parseUrl(PhysicalConnection.java:1335)oracle.jdbc.driver.PhysicalConnection。(PhysicalConnection.java: 747)在oracle.jdbc.driver.T4CConnection。(T4CConnection.java:495)在oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:56)在oracle.jdbc.driver.OracleDriver.connect(OracleDriver .java:747),网址为oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:562)... 78更多

4条回答
独立观察员
2020-08-14 08:12

我遇到了同样的问题。 我通过用双引号将密码引起来解决了这个问题。 希望这对您也有帮助。

私有最终字符串PASSWORD =" \"paßwört!\""; 

一周热门 更多>