Java SE 7 Don't Get Left Behind

Oracle公司在7月28日发布了Java SE 7。Java SE 7是在Oracle将Java收入囊中后一个重要的版本更新。

在了解Java SE 7之前有必要回顾一下Java的历史,自1996年”OaK”项目开始,这一编程语言迅速风靡了全世界:

Java 1.0 , codename “Oak”, was released in 1996. It can be considered a revolution in software development. Neither object orientation , virtual machines nor garbage collection were new ideas, but Java was the first language that got real traction. At the time the other big . . . → Read More: Java SE 7 Don’t Get Left Behind

使用CLI解析Java命令行参数

最近准备用Java写一个数据抽取的小玩样,不过距离我上一次用Java写程序已经过去了N(N>4)年了;没有读过<Java编程思想>,深深地觉得现在写出来的代码很不Java风格…..

因为需要在命令行中用到比较复杂的参数(argument),所以想到利用CLI库来解决这一块。

CLI库的Jar文件可以从Apache Commons下载到,目前比较成熟的是CLI 1.2版本。

要使用CLI,我们需要创建一个Options Class的实例对象:

Options Maclean=new Options();

通过该Options对象我们可以定义命令行程序可接受的参数(argument)。加入参数的一种方式是使用addOptions()方法:

JDUL.addOption(“END” ,true, “select the Big or Little Endian”);

为命令行程序定义可接受参数后,还需要命令行解析器CommandLineParser进一步解析输入的参数:

BasicParser parser = new BasicParser(); CommandLine cl = parser.parse(JDUL, args);

下面是一段完整的命令行参数解析示例代码:

package par; import org.apache.commons.cli.BasicParser; import org.apache.commons.cli.Options; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.ParseException; public class Main { /** * @param args the command line arguments . . . → Read More: 使用CLI解析Java命令行参数

JDBC THIN connection error : ORA-17401 at TmerInfo.pageSelect-InlineParameterMap

Problem Description: our application is JDBC thin client, B/S connection . and when open application webpage,it raise error sometimes.after it throw exceptions,any SQL request will be error again until restart application program.Error log key words: –SQLException error code[17401] –The error occurred while applying a parameter map. –Check the TmerInfo.pageSelect-InlineParameterMap. –Cause: java.sql.SQLException: Protocol violation

we test . . . → Read More: JDBC THIN connection error : ORA-17401 at TmerInfo.pageSelect-InlineParameterMap