# Class Driver

java.lang.Object
org.mariadb.jdbc.Driver

All Implemented Interfaces:
  `Driver`

public final class Driver extends Object implements Driver
MariaDB Driver

## Constructor Summary

Constructors
Constructor
Description
`Driver()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`acceptsURL(String url)`
returns true if the driver can accept the url.
`Connection`
`connect(String url, Properties props)`
Connect to the given connection string.
`static Connection`
`connect(Configuration configuration)`
Connect according to configuration
`static String`
`enquoteIdentifier(String identifier, boolean alwaysQuote)`
`static String`
`enquoteLiteral(String val)`
Enquote String value.
`int`
`getMajorVersion()`
gets the major version of the driver.
`int`
`getMinorVersion()`
gets the minor version of the driver.
`Logger`
`getParentLogger()`
`DriverPropertyInfo[]`
`getPropertyInfo(String url, Properties info)`
Get the property info.
`static boolean`
`isSimpleIdentifier(String identifier)`
Retrieves whether identifier is a simple SQL identifier.
`boolean`
`jdbcCompliant()`
checks if the driver is jdbc compliant.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Driver

public Driver()

## Method Details

### connect

public static Connection connect(Configuration configuration) throws SQLException
Connect according to configuration

Parameters:
  `configuration` - configuration
Returns:
  a Connection
Throws:
  `SQLException` - if connect fails

### connect

public Connection connect(String url, Properties props) throws SQLException
Connect to the given connection string.

Specified by:
  `connect` in interface `Driver`
Parameters:
  `url` - the url to connect to
Returns:
  a connection
Throws:
  `SQLException` - if it is not possible to connect

### acceptsURL

public boolean acceptsURL(String url)
returns true if the driver can accept the url.

Specified by:
  `acceptsURL` in interface `Driver`
Parameters:
  `url` - the url to test
Returns:
  true if the url is valid for this driver

### getPropertyInfo

public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
Get the property info.

Specified by:
  `getPropertyInfo` in interface `Driver`
Parameters:
  `url` - the url to get properties for
  `info` - the info props
Returns:
  all possible connector options
Throws:
  `SQLException` - if there is a problem getting the property info

### getMajorVersion

public int getMajorVersion()
gets the major version of the driver.

Specified by:
  `getMajorVersion` in interface `Driver`
Returns:
  the major versions

### getMinorVersion

public int getMinorVersion()
gets the minor version of the driver.

Specified by:
  `getMinorVersion` in interface `Driver`
Returns:
  the minor version

### jdbcCompliant

public boolean jdbcCompliant()
checks if the driver is jdbc compliant.

Specified by:
  `jdbcCompliant` in interface `Driver`
Returns:
  true since the driver is not compliant

### getParentLogger

public Logger getParentLogger() throws SQLFeatureNotSupportedException

Specified by:
  `getParentLogger` in interface `Driver`
Throws:
  `SQLFeatureNotSupportedException`

### enquoteIdentifier

public static String enquoteIdentifier(String identifier, boolean alwaysQuote) throws SQLException

Throws:
  `SQLException`

### enquoteLiteral

public static String enquoteLiteral(String val)
Enquote String value.

Parameters:
  `val` - string value to enquote
Returns:
  enquoted string value

### isSimpleIdentifier

public static boolean isSimpleIdentifier(String identifier)
Retrieves whether identifier is a simple SQL identifier. The first character is an alphabetic character from a through z, or from A through Z The string only contains alphanumeric characters or the characters "_" and "$"

Parameters:
  `identifier` - identifier
Returns:
  true if identifier doesn't have to be quoted
See Also:
  - mariadb identifier name