Connecting to a database via JDBC

When I run the following code, it does not throw any Exception even though I did not provide any specific database URL.

String url = "jdbc:mysql:";

Connection conn = DriverManager.getConnection(url, "root", "root");

As per the OCP reviewer book by Boyarsky and Selikoff, the only valid part of a JDBC URL format is the protocol (jdbc) and product/vendor (mysql). Given above code, what does it do? Where do this connect?...

Read More »

By: StackOverFlow - Thursday, 8 November

Related Posts