- What is hash-collision in Hashtable and How it is handled in Java?
Answer: Two different keys with the same hash value.Two different entries will be kept in a single hash bucket to avoid the collision.
- What are the different driver types available in JDBC?
Answer: The driver types available in JDBC are:
- A JDBC-ODBC bridge
- A native-API partly Java technology-enabled driver
- A net-protocol fully Java technology-enabled driver
- A native-protocol fully Java technology-enabled driver
- Is JDBC-ODBC bridge multi-threaded?
Answer: No
- Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?
Answer: No
- What is the use of serializable?
Answer: To persist the state of an object into any perminant storage device.
- What is the use of transient?
Answer: It is an indicator to the JVM that those variables should not be persisted.It is the users responsibility to initialize the value when read back from the storage.
- What are the different level lockings using the synchronization keyword?
Answer: Class level lock Object level lock Method level lock Block level lock
- What is the use of preparedstatement?
Answer: Preparedstatements are precompiled statements.It is mainly used to speed up the process of inserting/updating/deleting especially when there is a bulk processing.
- What is callable statement? Tell me the way to get the callable statement?
Answer: Callable statements are used to invoke the stored procedures.You can obtain the callable statement from Connection using the following methods:
- prepareCall(String sql)
- prepareCall(String sql, int resultSetType, int resultSetConcurrency)
- In a statement, I am executing a batch.What is the result of the execution?
Answer: It returns the int array.The array contains the affected row count in the corresponding index of the SQL.