新增一筆記錄至XXX table,其中UNIQUEID要從UNIQUE_ID_SEQ SEQUENCE取值
INSERT INTO XXX (UNIQUEID, TYPE, ID) VALUES(NEXT VALUE FOR UNIQUE_ID_SEQ,'M','004123456789001');
閱讀全文...
Happy coding.
The secret to creativity is knowing how to hide your sources.— Albert Einstein
Good artists copy, great artists steal. – Pablo Picasso
INSERT INTO XXX (UNIQUEID, TYPE, ID) VALUES(NEXT VALUE FOR UNIQUE_ID_SEQ,'M','004123456789001');
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.oro.text.perl.Perl5Util
at org.apache.commons.validator.GenericValidator.matchRegexp(GenericValidator.java:65)
at com.fesc.bot.batch.BatchJob.downloadFiles(Unknown Source)
at com.fesc.bot.batch.FD903C.exec(Unknown Source)
at com.fesc.bot.batch.FD903C.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.oro.text.perl.Perl5Util
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:665)
at java.lang.ClassLoader.loadClass(ClassLoader.java:644)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:627)
... 4 more
解決:import java.lang.StringBuilder;
import java.lang.System;
import java.util.StringTokenizer;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
public class Test {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
for (int i=1000; i<1100; i++) {
sb.append(i).append(" ");
}
String str = sb.toString();
int runs = 100000;
for (int i = 0; i < 5; i++) {
{
long start = System.nanoTime();
for (int r = 0; r < runs; r++) {
StringTokenizer st = new StringTokenizer(str);
List list = new ArrayList();
while (st.hasMoreTokens()) {
list.add(st.nextToken());
}
}
long time = System.nanoTime() - start;
System.out.printf("StringTokenizer took an average of %.1f us%n", time / runs / 1000.0);
}
{
long start = System.nanoTime();
for (int r = 0; r < runs; r++) {
List list = Arrays.asList(str.split(" "));
}
long time = System.nanoTime() - start;
System.out.printf("String.split took an average of %.1f us%n", time / runs / 1000.0);
}
}
}
}
StringTokenizer took an average of 12.7 us
String.split took an average of 9.8 us
StringTokenizer took an average of 12.6 us
String.split took an average of 9.4 us
StringTokenizer took an average of 12.6 us
String.split took an average of 9.4 us
StringTokenizer took an average of 13.2 us
String.split took an average of 9.4 us
StringTokenizer took an average of 12.5 us
String.split took an average of 9.5 us
String str = "aaa:bbb:ccc:ddd";
String[] tokens = str.split(":");
for (String token:tokens) {
System.out.println(token);
}
aaa
bbb
ccc
ddd
String str = "aaa:bbb-ccc_ddd";
String[] tokens = str.split(":|-|_");
for (String token:tokens) {
System.out.println(token);
}
aaa
bbb
ccc
ddd
String str = "aaa-bbb-ccc.ddd";
String[] tokens = str.split("-|\\.");
for (String token:tokens) {
System.out.println(token);
}
aaa
bbb
ccc
ddd