How DriverManager knows that OracleDriver is there? In its static block OracleDriver, will get registered with DriverManager.
The driver is loaded and registered with Class.forName() and the example can be confusing to some one taking a SCJP. I dont think this has anything to do with static blocks.
Can't we use static block x anywhere? Then what is the purpose of define such one?
Use the static block when you want to initialize something once, when any instance of this class is loaded or used. For example, you want to calculate a number only once and make it public static. After that your class instances can use this number. You can use it under such circumstances. The variable x in the static block is not useful here.
I dont think this has anything to do with static blocks.
My humble apologies. That sentence sounds quite wrong. In the context of the SCJP, concepts of JDBC could be a bit hard to understand if the person has never connected to a database using JDBC. You are right in the fact that the static block is used to register the driver. More specifically the DriverManager.registerDriver() method is used from the block after an instance of the driver is instantiated. Sorry