java - Janino scriptella 与数组 List 的使用

标签 java scriptella janino

我正在尝试使用 scriptella 复制 oracle 的列,我想将它们插入到结合 scriptella 和 janino 的 ArrayList 中,以便稍后使用它们并进行比较,

这是我所做的

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
    <description>
        test script Pour table article
    </description>
    <connection id="in" driver="oracle"
        url="jdbc:oracle:thin:@localhost:1521:XE" user="IPTECH" password="IPTECH" />

    <connection id="out" driver="postgresql"
        url="jdbc:postgresql://localhost:5432/gemodb" user="postgres"
        password="maher" />
    <connection id="janino" driver="janino" />

    <query connection-id="in">
        select code,libelle from TMP_STRUCTURE;
        <script connection-id="janino">
            import java.util.*;
            import java.io.*;
            Boolean result=false;
            ArrayList<String> obj = new ArrayList <String>();
            String code =get("code").toString();
            obj.add(code);
        </script>
    </query>
</etl>

我遇到了以下问题

Unable to parse document: org.xml.sax.SAXParseException; systemId: file:/C:/Users/MHT/eclipse-workspace/Scriptella/test.xml; lineNumber: 23; columnNumber: 5; The element type "String" must be terminated by the matching end-tag "</String>".

任何帮助将不胜感激

最佳答案

你必须更换

 ArrayList<String> obj = new ArrayList <String>();

 java.util.ArrayList &lt; String> obj = new ArrayList java.util.ArrayList &lt; String>();

关于java - Janino scriptella 与数组 List 的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45845060/

相关文章:

java - Spring boot @ExceptionHandler 以 html 形式返回响应

java - Ehcache 不在同一台机器上的两个 tomcat 之间复制

mysql - 应如何使用 Scriptella 将带有 NULL 值的 CSV 加载到 MySQL 中?

linux - Scriptella:Jaybird 的 ResourceException

xml - 使用 Scriptella 将 XML 转换为 CSV,如何获取属性值?

java - 在 logback 中使用条件处理时找不到 FileExistsPropertyDefiner 类

java - Janino编译几个类

java - 在 main() 中记录 Throwable

java - 如何在Jmeter beanshell处理器中生成timeuuid?

java - 是否可以从 Xtend 字符串动态生成 Java 代码字符串?