English 中文(简体)
从模板在 Java 中创建动态控制文件
原标题:Create dynamic control file in java from template

我需要根据某些变量( 文件名、 坏文件名、 装入表格等) 创建一个控制文件( 用于 SQLLoader ) 。

现在,我有一个在 java 中创建文件并运行良好的方法。 当我必须修改控制文件的结构时, 我的问题就会出现。 我需要改变这个在 java 源代码中的代码, 编译, 取消前一个应用程序, 部署新的应用程序, 仅仅为了改变控制文件的结构 。

我在想,我是否有办法来制作一个模板, 在那里我只是通过变量(如上所述), 但在 Java之外,让我们说某种xml之类的东西, 所以我只是换个“模板”和我的应用程序, 填充变量。

问题回答

In one of our applications we generate the control file from code (in our case C#, but that doesn t matter) Create the file from a template (outside of your app), fill in the variables and have your application copy it to the place where SQLLoader expects it. Only thing you need is for your java app to have permission to write to that directory.

如果这是一个 Java 网络应用程序, 这有点棘手, 因为从 Webap 写入文件可能会带来安全风险 。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签