Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What are the various forms of getConnection for?

forms various
0
10 Posted

What are the various forms of getConnection for?

0

DriverManager defines three different forms of the getConnection method:getConnection(String)All of the information needed to describe the desired connection is encoded into the URL String parameter.getConnection(String, Properties)Some of the information is coded into the URL String parameter. The rest is passed as key value pairs in the Properties parameter. This is the most powerful and flexible of the three forms. There are properties that can be set using this form that cannot be set any other way.getConnection(String, String, String)This is a convenience method that passes the username and password as arguments rather than encoding them into the URL. It is frequently used in simple programs.DataSource defines two getConnection methods:getConnection()This method returns a connection created using the URL, username, and password used to create the DataSource. This is the most commonly used form of getConnection in large applications.getConnection(String, String)This method returns

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.