Java Doc for DriverManager.java in  » Apache-Harmony-Java-SE » java-package » java » sql » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.sql.DriverManager

DriverManager
public class DriverManager (Code)
Provides facilities for managing JDBC Drivers.

The DriverManager class will load JDBC drivers during its initialization, from the list of drivers referenced by the System Property "jdbc.drivers".





Method Summary
public static  voidderegisterDriver(Driver driver)
     Removes a driver from the DriverManager's registered driver list.
public static  ConnectiongetConnection(String url)
     Attempts to establish a connection to the given database URL.
Parameters:
  url - a URL string representing the database target to connect with a Connection to the database identified by the URL.
public static  ConnectiongetConnection(String url, Properties info)
     Attempts to establish a connection to the given database URL.
Parameters:
  url - a URL string representing the database target to connect with
Parameters:
  info - a set of Properties to use as arguments to set up theconnection.
public static  ConnectiongetConnection(String url, String user, String password)
     Attempts to establish a connection to the given database URL.
Parameters:
  url - a URL string representing the database target to connect with
Parameters:
  user - a userid used to login to the database
Parameters:
  password - a password for the userid to login to the database a Connection to the database identified by the URL.
public static  DrivergetDriver(String url)
     Tries to find a driver that can interpret the supplied URL.
Parameters:
  url - the URL of a database a Driver that can understand the given URL.
public static  Enumeration<Driver>getDrivers()
     Returns an Enumeration that contains all of the loaded JDBC drivers that the current caller can access.
public static  PrintStreamgetLogStream()
    
public static  PrintWritergetLogWriter()
     Retrieves the log writer. A PrintWriter object used as the log writer.
public static  intgetLoginTimeout()
     Returns the login timeout when connecting to a database, in seconds.
public static  voidprintln(String message)
     Prints a message to the current JDBC log stream.
public static  voidregisterDriver(Driver driver)
     Registers a given JDBC driver with the DriverManager.
public static  voidsetLogStream(PrintStream out)
    
public static  voidsetLogWriter(PrintWriter out)
     Sets the PrintWriter that will be used by all loaded drivers, and also the DriverManager.
public static  voidsetLoginTimeout(int seconds)
     Set the login timeout when connecting to a database, in seconds.
Parameters:
  seconds - seconds until timeout.



Method Detail
deregisterDriver
public static void deregisterDriver(Driver driver) throws SQLException(Code)
Removes a driver from the DriverManager's registered driver list. This will only succeed where the caller's classloader loaded the driver that is to be removed. If the driver was loaded by a different classloader, the removal of the driver will fail silently.

If the removal succeeds, the DriverManager will not in future use this driver when asked to get a Connection.
Parameters:
  driver -
throws:
  SQLException - if there is an exception accessing the database.




getConnection
public static Connection getConnection(String url) throws SQLException(Code)
Attempts to establish a connection to the given database URL.
Parameters:
  url - a URL string representing the database target to connect with a Connection to the database identified by the URL. null if noconnection can be made.
throws:
  SQLException - if there is an error while attempting to connect to thedatabase identified by the URL



getConnection
public static Connection getConnection(String url, Properties info) throws SQLException(Code)
Attempts to establish a connection to the given database URL.
Parameters:
  url - a URL string representing the database target to connect with
Parameters:
  info - a set of Properties to use as arguments to set up theconnection. Properties are arbitrary string/value pairs.Normally, at least the properties "user" and "password" shouldbe passed, with appropriate settings for the userid and itscorresponding password to get access to the databaseconcerned. a Connection to the database identified by the URL. null if noconnection can be made.
throws:
  SQLException - if there is an error while attempting to connect to thedatabase identified by the URL



getConnection
public static Connection getConnection(String url, String user, String password) throws SQLException(Code)
Attempts to establish a connection to the given database URL.
Parameters:
  url - a URL string representing the database target to connect with
Parameters:
  user - a userid used to login to the database
Parameters:
  password - a password for the userid to login to the database a Connection to the database identified by the URL. null if noconnection can be made.
throws:
  SQLException - if there is an error while attempting to connect to thedatabase identified by the URL



getDriver
public static Driver getDriver(String url) throws SQLException(Code)
Tries to find a driver that can interpret the supplied URL.
Parameters:
  url - the URL of a database a Driver that can understand the given URL. null if no Driverunderstands the URL
throws:
  SQLException - if there is any kind of Database Access problem



getDrivers
public static Enumeration<Driver> getDrivers()(Code)
Returns an Enumeration that contains all of the loaded JDBC drivers that the current caller can access. An Enumeration containing all the currently loaded JDBC Drivers



getLogStream
public static PrintStream getLogStream()(Code)
the PrintStream used for logging activity



getLogWriter
public static PrintWriter getLogWriter()(Code)
Retrieves the log writer. A PrintWriter object used as the log writer. null if no logwriter is set.



getLoginTimeout
public static int getLoginTimeout()(Code)
Returns the login timeout when connecting to a database, in seconds. the login timeout in seconds



println
public static void println(String message)(Code)
Prints a message to the current JDBC log stream. This is either the PrintWriter or (deprecated) the PrintStream, if set.
Parameters:
  message - the message to print to the JDBC log stream



registerDriver
public static void registerDriver(Driver driver) throws SQLException(Code)
Registers a given JDBC driver with the DriverManager.

A newly loaded JDBC driver class should register itself with the DriverManager by calling this method.
Parameters:
  driver - the Driver to register with the DriverManager
throws:
  SQLException - if a database access error occurs.




setLogStream
public static void setLogStream(PrintStream out)(Code)

Parameters:
  out - the PrintStream to use for logging.



setLogWriter
public static void setLogWriter(PrintWriter out)(Code)
Sets the PrintWriter that will be used by all loaded drivers, and also the DriverManager.
Parameters:
  out - the PrintWriter to be used



setLoginTimeout
public static void setLoginTimeout(int seconds)(Code)
Set the login timeout when connecting to a database, in seconds.
Parameters:
  seconds - seconds until timeout. 0 indicates wait forever.



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.