Java Doc for NonRegisteringDriver.java in  » Database-JDBC-Connection-Pool » mysql-connector-java-5.1.3 » com » mysql » jdbc » 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 » Database JDBC Connection Pool » mysql connector java 5.1.3 » com.mysql.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.mysql.jdbc.NonRegisteringDriver

NonRegisteringDriver
public class NonRegisteringDriver implements java.sql.Driver(Code)
The Java SQL framework allows for multiple database drivers. Each driver should supply a class that implements the Driver interface

The DriverManager will try to load as many drivers as it can find and then for any given connection request, it will ask each driver in turn to try to connect to the target URL.

It is strongly recommended that each Driver class should be small and standalone so that the Driver class can be loaded and queried without bringing in vast quantities of supporting code.

When a Driver class is loaded, it should create an instance of itself and register it with the DriverManager. This means that a user can load and register a driver by doing Class.forName("foo.bah.Driver")


author:
   Mark Matthews
version:
   $Id: NonRegisteringDriver.java,v 1.1.2.1 2005/05/13 18:58:38
version:
   mmatthews Exp $
See Also:   org.gjt.mm.mysql.Connection
See Also:   java.sql.Driver


Field Summary
final public static  StringDBNAME_PROPERTY_KEY
     Key used to retreive the database value from the properties instance passed to the driver.
final public static  booleanDEBUG
    
final public static  intHOST_NAME_INDEX
     Index for hostname coming out of parseHostPortPair().
final public static  StringHOST_PROPERTY_KEY
     Key used to retreive the hostname value from the properties instance passed to the driver.
final public static  StringPASSWORD_PROPERTY_KEY
     Key used to retreive the password value from the properties instance passed to the driver.
final public static  intPORT_NUMBER_INDEX
     Index for port # coming out of parseHostPortPair().
final public static  StringPORT_PROPERTY_KEY
     Key used to retreive the port number value from the properties instance passed to the driver.
final public static  StringPROPERTIES_TRANSFORM_KEY
    
final public static  booleanTRACE
    
final public static  StringUSER_PROPERTY_KEY
     Key used to retreive the username value from the properties instance passed to the driver.
final public static  StringUSE_CONFIG_PROPERTY_KEY
    

Constructor Summary
public  NonRegisteringDriver()
    

Method Summary
public  booleanacceptsURL(String url)
     Typically, drivers will return true if they understand the subprotocol specified in the URL and false if they don't.
public  java.sql.Connectionconnect(String url, Properties info)
     Try to make a database connection to the given URL.
public  Stringdatabase(Properties props)
     Returns the database property from props
Parameters:
  props - the Properties to look for the database property.
public  intgetMajorVersion()
    
static  intgetMajorVersionInternal()
    
public  intgetMinorVersion()
    
static  intgetMinorVersionInternal()
    
public  DriverPropertyInfo[]getPropertyInfo(String url, Properties info)
     The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database.

Note that depending on the values the human has supplied so far, additional values may become necessary, so it may be necessary to iterate through several calls to getPropertyInfo


Parameters:
  url - the Url of the database to connect to
Parameters:
  info - a proposed list of tag/value pairs that will be sent onconnect open.
public  Stringhost(Properties props)
     Returns the hostname property
Parameters:
  props - the java.util.Properties instance to retrieve the hostnamefrom.
public  booleanjdbcCompliant()
     Report whether the driver is a genuine JDBC compliant driver.
protected static  String[]parseHostPortPair(String hostPortPair)
     Parses hostPortPair in the form of [host][:port] into an array, with the element of index HOST_NAME_INDEX being the host (or null if not specified), and the element of index PORT_NUMBER_INDEX being the port (or null if not specified).
public  PropertiesparseURL(String url, Properties defaults)
    
public  intport(Properties props)
    
public  Stringproperty(String name, Properties props)
    

Field Detail
DBNAME_PROPERTY_KEY
final public static String DBNAME_PROPERTY_KEY(Code)
Key used to retreive the database value from the properties instance passed to the driver.



DEBUG
final public static boolean DEBUG(Code)
Should the driver generate debugging output?



HOST_NAME_INDEX
final public static int HOST_NAME_INDEX(Code)
Index for hostname coming out of parseHostPortPair().



HOST_PROPERTY_KEY
final public static String HOST_PROPERTY_KEY(Code)
Key used to retreive the hostname value from the properties instance passed to the driver.



PASSWORD_PROPERTY_KEY
final public static String PASSWORD_PROPERTY_KEY(Code)
Key used to retreive the password value from the properties instance passed to the driver.



PORT_NUMBER_INDEX
final public static int PORT_NUMBER_INDEX(Code)
Index for port # coming out of parseHostPortPair().



PORT_PROPERTY_KEY
final public static String PORT_PROPERTY_KEY(Code)
Key used to retreive the port number value from the properties instance passed to the driver.



PROPERTIES_TRANSFORM_KEY
final public static String PROPERTIES_TRANSFORM_KEY(Code)



TRACE
final public static boolean TRACE(Code)
Should the driver generate method-call traces?



USER_PROPERTY_KEY
final public static String USER_PROPERTY_KEY(Code)
Key used to retreive the username value from the properties instance passed to the driver.



USE_CONFIG_PROPERTY_KEY
final public static String USE_CONFIG_PROPERTY_KEY(Code)




Constructor Detail
NonRegisteringDriver
public NonRegisteringDriver() throws SQLException(Code)
Construct a new driver and register it with DriverManager
throws:
  SQLException - if a database error occurs.




Method Detail
acceptsURL
public boolean acceptsURL(String url) throws SQLException(Code)
Typically, drivers will return true if they understand the subprotocol specified in the URL and false if they don't. This driver's protocols start with jdbc:mysql:
Parameters:
  url - the URL of the driver true if this driver accepts the given URL
exception:
  SQLException - if a database-access error occurs
See Also:   java.sql.Driver.acceptsURL



connect
public java.sql.Connection connect(String url, Properties info) throws SQLException(Code)
Try to make a database connection to the given URL. The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL. This will be common, as when the JDBC driverManager is asked to connect to a given URL, it passes the URL to each loaded driver in turn.

The driver should raise an SQLException if it is the right driver to connect to the given URL, but has trouble connecting to the database.

The java.util.Properties argument can be used to pass arbitrary string tag/value pairs as connection arguments.

My protocol takes the form:

 jdbc:mysql://host:port/database
 


Parameters:
  url - the URL of the database to connect to
Parameters:
  info - a list of arbitrary tag/value pairs as connection arguments a connection to the URL or null if it isnt us
exception:
  SQLException - if a database access error occurs
See Also:   java.sql.Driver.connect



database
public String database(Properties props)(Code)
Returns the database property from props
Parameters:
  props - the Properties to look for the database property. the database name.



getMajorVersion
public int getMajorVersion()(Code)
Gets the drivers major version number the drivers major version number



getMajorVersionInternal
static int getMajorVersionInternal()(Code)
Gets the drivers major version number the drivers major version number



getMinorVersion
public int getMinorVersion()(Code)
Get the drivers minor version number the drivers minor version number



getMinorVersionInternal
static int getMinorVersionInternal()(Code)
Get the drivers minor version number the drivers minor version number



getPropertyInfo
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException(Code)
The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties it should prompt a human for in order to get enough information to connect to a database.

Note that depending on the values the human has supplied so far, additional values may become necessary, so it may be necessary to iterate through several calls to getPropertyInfo


Parameters:
  url - the Url of the database to connect to
Parameters:
  info - a proposed list of tag/value pairs that will be sent onconnect open. An array of DriverPropertyInfo objects describing possibleproperties. This array may be an empty array if no properties arerequired
exception:
  SQLException - if a database-access error occurs
See Also:   java.sql.Driver.getPropertyInfo



host
public String host(Properties props)(Code)
Returns the hostname property
Parameters:
  props - the java.util.Properties instance to retrieve the hostnamefrom. the hostname



jdbcCompliant
public boolean jdbcCompliant()(Code)
Report whether the driver is a genuine JDBC compliant driver. A driver may only report "true" here if it passes the JDBC compliance tests, otherwise it is required to return false. JDBC compliance requires full support for the JDBC API and full support for SQL 92 Entry Level.

MySQL is not SQL92 compliant

is this driver JDBC compliant?



parseHostPortPair
protected static String[] parseHostPortPair(String hostPortPair) throws SQLException(Code)
Parses hostPortPair in the form of [host][:port] into an array, with the element of index HOST_NAME_INDEX being the host (or null if not specified), and the element of index PORT_NUMBER_INDEX being the port (or null if not specified).
Parameters:
  hostPortPair - host and port in form of of [host][:port] array containing host and port as Strings
throws:
  SQLException - if a parse error occurs



parseURL
public Properties parseURL(String url, Properties defaults) throws java.sql.SQLException(Code)



port
public int port(Properties props)(Code)
Returns the port number property
Parameters:
  props - the properties to get the port number from the port number



property
public String property(String name, Properties props)(Code)
Returns the given property from props
Parameters:
  name - the property name
Parameters:
  props - the property instance to look in the property value, or null if not found.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) 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.