如何将其他语言的数据映射到java
我们必须存储使用 IBM 的 Ab-Initio 产品创建的一些平面文件中的数据。它们有自己的数据类型,当我在 java 中处理这些数据时,我需要将它们映射到 java 数据类型。
有谁知道这样做的好技术是什么?他们有 Java API 可以这样做吗?
我想到的最简单的技术是在检查 Ab-Initio 中的大小并选择代表 Java 中该大小和类型的数据类型后创建 Ab-Initio 到 Java 类型的映射。
任何意见表示赞赏!
谢谢, -JJ
We have to store data from some flat files that is created using IBM's Ab-Initio product. They have their own datatypes that I need to map to java data-types while I process that data in java.
Does anyone know what would a good technique to do so ? Are their any java APIs to do so ?
simplest technique I have in mind is to create a map of Ab-Initio to Java type after checking the size in Ab-Initio and choosing datatype that represents that size and type in Java.
Any inputs are appreciated !
Thanks,
-JJ
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在各种语言之间转换数据时,我喜欢坚持几个基本数据结构,它们似乎能够处理任何类型的数据:
当然,在 Java 中,当属性的完整域已知时,创建具有 bean 属性的对象而不是 Map 是规范的。
When converting data between various languages I like to stick to a couple basic data structures which seem to be able to handle any type of data:
Of course, in Java, it's canonical to create an object with bean properties instead of a Map when the full domain of attributes is known.
在大多数从头开始的过程中,在写入平面文件之前,即使没有执行任何转换,也会在写入文件之前或写入文件的步骤之前对数据执行一些转换,存在中间 DML,其中包含每列的数据定义,其中大部分是通用定义,您所需要做的就是要求 ab-initio 开发人员向您发送该通用 dml 的副本,然后您可以将此 DML 发送到java 中的映射值。希望这有帮助。
In most ab-inito processes, just before a flat file is written, some transformation is performed on the data, even if there in no transformation performed, before writing to the file, or a step before the step that writes to the file, an intermediate DML is present which contains the data definitions for each columns, most of these are generic definitions, all you need to do is ask the ab-initio developer to send you a copy of that generic dml, and then you can you this DML to map values in java. Hope this helps.