# Class: NodeJDBC

Defined in: | src/nodejdbc.coffee

## Overview

Main class for connection. Basically initializes configuration and supplies connection object

## Variables Summary

_connection =

      undefined

  Connection object. Initilized once for each new NodeJDBC

## Instance Method Summary

- # (Connection) newConnection() Each time creates new connection to the given datasource! Use NodeJDBC#getConnection for creating and reusing connections.
- # (Connection) getConnection() Create or return existing connection object if it is created before.
- # (Statement) createStatement() Each time creates a statement from given configuration.
- # (void) classForName() initialize driver class name in java this is : Class.forName('jdbc.class.name')
- # (void) registerDriver() registers jdbc driver
- # (void) validateConfig() validates given configuration object
- # (void) printConfig() print configuration object

## Constructor Details

# (void) constructor(config)

constructor method initializes classpath and registers jdbc driver. Also validates the given configuration object

### Parameters:

- config ( `Object` ) — configuration parameters for NodeJDBC and java instance

### Options Hash: (options):

- libs ( `Array` ) — list of libraries that will be added to classpath. driver jars are specified here. If you want to extend NodeJDBC and use other java libraries you can also suply additional jars here. @example ['lib/sqlite-jdbc-3.8.11.2.jar','commons-collections-3.2.1.jar']
- className ( `String` ) — driver class name @example 'org.sqlite.JDBC'
- url ( `String` ) — jdbc url @example 'jdbc:sqlite:test.db'

## Instance Method Details

# (Connection) newConnection()

Each time creates new connection to the given datasource! Use NodeJDBC#getConnection for creating and reusing connections.

### Returns:

- ( `Connection` ) — A promise that returns a new Connection object

# (Connection) getConnection()

Create or return existing connection object if it is created before.

### Returns:

- ( `Connection` ) — A promise that returns a Connection object

### See also:

- {NodeJDBC.newConnection}

# (Statement) createStatement()

Each time creates a statement from given configuration. This is rather a shorthand method. Instead directly create statement in your code unless you want a new statement each time.

### Returns:

- ( `Statement` ) — A promise that returns a Statement object

# (void) classForName()

initialize driver class name in java this is : Class.forName('jdbc.class.name')

# (void) registerDriver()

registers jdbc driver

# (void) validateConfig()

validates given configuration object

### See also:

- constructor}

# (void) printConfig()

print configuration object

Quickly fuzzy find classes, mixins, methods, file:

- T Open fuzzy finder dialog

Control the navigation frame:

- L Toggle list view
- C Show class list
- I Show mixin list
- F Show file list
- M Show method list
- E Show extras list

You can focus and blur the search input:

- S Focus search input
- Esc Blur search input