我正在编写一个Java应用程序,用于将数据从Oracle导出到csv文件
不幸的是,数据内容可能非常棘手.仍然逗号是deliminator,但行上的一些数据可能是这样的:
ID FN LN 年龄 评论
123,约翰,史密斯,39岁,我说"嘿,我是5'10"."
所以这是comment列上的字符串之一:
我说"嘿,我5'10"."
不开玩笑,我需要在excel或开放式办公室中从Java生成的CSV文件中显示以上评论,当然不能搞乱其他常规转义情况(即常规双引号和元组内的常规逗号).我知道正则表达式很强大,但我们怎样才能在如此复杂的情况下实现目标呢?
我已经和Maven一起工作了几天,但仍对某些术语感到困惑:
第一个问题是repository和之间有什么区别pluginRepository?如果存在功能差异,那么我应该为两者添加一个网址吗?
第二个问题是dependency和之间有什么区别plugin?也许它们是完全不同的项目比较因为plugin可以包括dependencies,但对我来说plugins看起来像构建中的某种依赖项?就像"这build取决于这些插件,其中一个插件依赖于依赖",我一直认为依赖是一种库jar,而插件是库jar或依赖jar中的项目...
对不起,如果问题有点愚蠢,但我真的很困惑.请提示,谢谢.
我是JasperReports的新手,一直在研究一些小样本.似乎"Fields","Parameters"和"Variables"非常常用于演示动态数据,看起来很相似.那么我可以问一下JasperReports中他们的区别是什么吗?
我猜变量是Jasper报告中定义的东西,可以动态变化.参数是从外部源(Java..etc)获取的,字段是实体(数据库模式,类实体),但我不认为我的理解是正确的.
我试过了
select * from users
save D:\test.sql create;
Run Code Online (Sandbox Code Playgroud)
但是SQL plus给了我"没有正确结束"如何在windows中的oracle sql中指定路径?
这是pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-js-resources-thin</artifactId>
<version>2.2.1.RELEASE</version>
<name>Spring js lib</name>
<description>Spring javascript library without dojo</description>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud)
这是 assembly.xml
<assembly>
<id>js-jar</id>
<formats>
<format>jar</format>
</formats>
<fileSets>
<fileSet>
<directory>src/main/resources/</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>META-INF/**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
Run Code Online (Sandbox Code Playgroud)
问题是,每当我打开生成的jar文件(spring-js-resources-thin-2.2.1.RELEASE-js-jar.jar)时,根文件夹总是命名为artifactid-version(spring-js-resources-thin-2.2) .1.RELEASE),然后是META-INF.
我想知道无论如何我都可以使用文件名构建jar文件artifactid-version.jar,但是artifactid-version在类路径中没有,就像maven存储库中的每个jar一样.我认为应该有一个选项或方法来命名<outputDirectory>.
假设我们有双重值12345.6789(应该是动态的)
现在要求是将数字拆分并得到小数位数和小数位数,这将是:
double number = 12345.6789;
int decimal = 12345;
int fractional = 6789;
Run Code Online (Sandbox Code Playgroud)
我得到了小数部分,但是你能不能给出小数部分的提示?非常感谢.
有没有一般的方法可以
if(entity is persisted before){
entity = entity.merge();
}else{
entity.persist();
}
Run Code Online (Sandbox Code Playgroud)
所以包含上述逻辑的方法到处都是安全的吗?
我知道这不是一个最好的设计,而只是一个Spring新手的想法.
现在我们可以autowire在Spring框架中方便地将任何服务方法相互配合.但是创建服务类的静态工厂方法并在任何地方调用它有什么缺点?
它很常见:
@Autowired
CustomerService customerService;
....
AccountDetail ad = customerService.getAccountDetail(accountId, type);
Run Code Online (Sandbox Code Playgroud)
但这也应该有效:
AccountDetail ad = CustomerService.getAccountDetail(accountId, type); //if we make getAccountDetail(String, String) static
Run Code Online (Sandbox Code Playgroud)
那么为什么有像autowire这样的设计呢?它看起来很花哨而且很酷,但是这背后的工作仍然是在另一个服务对象上创建一个服务bean实例.
说实话,春天到处都是市场,所以很多帖子和文章都在谈论专业和装修.但它是否保证了更好的性能(比如使用autowire而不是静态)?
我们的Web应用程序遇到了复杂的情况
它是由STS /开发的Spring应用程序Tomcat 7.应用程序集成后Jasper report 4.6.0,它总是抛出`OutOfMemoryError:PermGen Space.然后,让它工作的唯一方法是重新启动应用程序.但过了一段时间它又发生了.这是异常之前的日志:
Oct 17, 2012 3:42:27 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Oct 17, 2012 3:42:30 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception …Run Code Online (Sandbox Code Playgroud)