Please verify if the connection url you used in the connection string is valid for MySQL. JDBC (4.0 ? not sure if the same applies to previous versions as well) checks if there is a driver accepting a given connection url.
I removed "thin". Now its working but I'm super confused.
I gues I mixed syntaxes for OracleDB and Mysql :
Oracle : jdbc: oracle:thin:@localhost:1521:xe
MySQL : jdbc:mysql://localhost/jdbcdemo
I thought "thin" is used for a driver. Why aren't we using that in MySQL syntax ?
The "thin" part is an Oracle thing; it does not apply to MySQL. Actually, the entire part after the 2nd colon is specific to the driver, so there's a lot of variety.