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.