Page 1 of 1

About Question enthuware.ocpjp.ii.v11.2.1199 :

Posted: Fri Jul 10, 2020 11:20 am
by liugengyu
A JDBC driver implementation must provide implementation classes for which of the following interfaces?
I don't understand the question and the answer at all. :x What does it mean by JDBC driver implementation? Can soneone explain it for me?

Thanks a lot. :)

Re: About Question enthuware.ocpjp.ii.v11.2.1199 :

Posted: Fri Jul 10, 2020 11:30 am
by admin
The Java JDBC package is just a set of interfaces and helper classes. They don't really contain any code to actually connect to any database and fetch data/execute queries etc. Every database vendor (such as Oracle, MSSQL, MySQL etc.) provides the implementation classes for these interfaces, which do the real work of connecting to their database.

See this for details: https://www.marcobehler.com/guides/jdbc

Re: About Question enthuware.ocpjp.ii.v11.2.1199 :

Posted: Fri Jul 10, 2020 11:46 am
by liugengyu
Understood. Already added your comments into my note. Thanks!

Re: About Question enthuware.ocpjp.ii.v11.2.1199 :

Posted: Fri Jul 10, 2020 11:48 am
by liugengyu
admin wrote:
Fri Jul 10, 2020 11:30 am
The Java JDBC package is just a set of interfaces and helper classes. They don't really contain any code to actually connect to any database and fetch data/execute queries etc. Every database vendor (such as Oracle, MSSQL, MySQL etc.) provides the implementation classes for these interfaces, which do the real work of connecting to their database.

See this for details: https://www.marcobehler.com/guides/jdbc
Understood. Already added your comments into my note. Thanks!

Re: About Question enthuware.ocpjp.ii.v11.2.1199 :

Posted: Sun Jan 17, 2021 2:12 pm
by Deleted User 6318
The most important benefit is that the application code does not need to have access to database connection details (i.e. userid, pwd, and dburl).
Doesn't it?
I'm going through Oracle tutorial (I know it's written for Java 8, but did it really change later?) at https://docs.oracle.com/javase/tutorial ... urces.html and from what I see, you still need to pass user and password when getting a connection.

Re: About Question enthuware.ocpjp.ii.v11.2.1199 :

Posted: Sun Jan 17, 2021 11:56 pm
by admin
Yes, a DataSource is configured in the application contaciner. Application code simply looks the data source up using JNDI and call dataSource.getConnection(). No connection parameters are required because application code does not "create" a data source. The deployer creates (actually, "configures") datasource in the application container. While configuration, the deployer specifies the url, userid, password, and other connection parameters.