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);