If the JDBC API is not able to locate the JDBC driver, it will throw a SQLException. If there are jars for the drivers available, they need to be included in the classpath to enable the JDBC API to locate the driverjava
ResultSet一开始游标指向的是第一条前面,因此必须运行.next()拿到第一条正则表达式
RowSet是种特殊的支持JavaBean组件的ResultSet
JdbcRowSet:
CachedRowSet: disconnected ResultSet
WebRowSet: CachedRowset + XML (没有说这个是JSON格式喔)
JoinRowSet: WebRowset + SQL join
FilteredRowSet: WebRowset + filteringc#
JDBC 4.1 introduces the capability to use try-with-resources statement to close resources (Connection, ResultSet,and Statement) automatically.oracle
try-catch的异常若是相似并且处理方式也相似的话,能够考虑使用multi-catch块 app
即便在catch中return了,也仍是会执行到finally的,除非执行的是system.exit(n), 由于这个是停掉全部包括其它的dom
static initialization block cannot throw any checked exceptions. now-static initialization blocks can. however, all the constructors should declare that exception in their throws clauseide
重写的方法中throw的异常只能比父类的异常更具体,而不能更宽泛,或者不throws也是能够的函数
若是方法在实现的多个接口中都存在且抛出的异常不一样,则实现的方法应该同时抛出这些异常this
自定义exception最后继承于Exception或RuntimeException,而不要直接继承Throwable,这个是JVM预留的spa
bundlename_language_country_#script.properties
Format (抽象类)
NumberFormat
DateFormat - 大写W/D/F(day of week)的是in year, 小写w/d/f的是in month,大写S是毫秒,大写K是am/pm小时数,小写k是hour (1-24), H是(0-23)
SimpleDateFormat
sleep(): 不会release the lock,会hold on to the lock
join(): wait for another thread to terminate
仍然不懂的:
static method 不能够被override
接口里的方法只能为public & abstract,不然会出编译错“Illegal modifier for the interface method say; only public & abstract are permitted”
接口里面的field只能为public, final & static,不然会出编译错“Illegal modifier for the interface field Foo.iVisual; only public, static & final are permitted”
前期绑定和后期绑定
static block: A constructor will be invoked when an instance of the class is created, while the static block will be invoked when the program initializes
接口内部类自动都是public static的,至关于为接口定义了一种变量类型
System.out.println(et.TEST2); // et定义为一个静态类的常量后,仍然能够用et.TEST2来取到TEST2的常量
由于enum是final static public的,因此不能定义在local inter class中
FileWriter fw = FileWriter(path, boolean isAppend)
fw.append("test001");
fw.close();
若是没有第二个boolean参数,默认为覆盖写。
A setAutoCommit (False) method invocation starts a transaction context.
看一下正则表达式
\\s* matches 0 or more occurrences of whitespaces.
ScheduledExecutorService
The method used to obtain the Executor determines how many Threads are used to execute tasks.
看集合类图,象Q144
Class Hashtable extends Dictionary implements Serializable, Cloneable, Map。
Interface SortedMap extends Map
Change FileReader to BufferReader.
public class BufferedReader extends Reader
Read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.
The buffer size may be specified, or the default size may be used. The default is large enough for most purposes.
ThreadLocalRandom.current().nextInt(1, 101);