org.apache.ignite.internal.jdbc2

## Class JdbcUtils

- java.lang.Object
- - org.apache.ignite.internal.jdbc2.JdbcUtils

    public class JdbcUtils
    extends Object

Utility methods for JDBC driver.

### Constructor Summary

Constructors
Constructor and Description
`JdbcUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static SQLException` `convertToSqlException(Exception e, String msgForUnknown)` Convert exception to `SQLException`.
`static SQLException` `convertToSqlException(Exception e, String msgForUnknown, String sqlStateForUnknown)` Convert exception to `SQLException`.
`static boolean` `nullable(String name, String cls)` Determines whether type is nullable.
`static int` `type(String cls)` Converts Java class name to type from `Types`.
`static String` `typeName(String cls)` Converts Java class name to SQL type name.

### Methods inherited from class java.lang.Object

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

### Constructor Detail

#### JdbcUtils

    public JdbcUtils()

### Method Detail

#### type

    public static int type(String cls)

Converts Java class name to type from `Types`.

Parameters:
  `cls` - Java class name.
Returns:
  Type from `Types`.

#### typeName

    public static String typeName(String cls)

Converts Java class name to SQL type name.

Parameters:
  `cls` - Java class name.
Returns:
  SQL type name.

#### nullable

    public static boolean nullable(String name,
                                   String cls)

Determines whether type is nullable.

Parameters:
  `name` - Column name.
  `cls` - Java class name.
Returns:
  `True` if nullable.

#### convertToSqlException

    public static SQLException convertToSqlException(Exception e,
                                                     String msgForUnknown)

Convert exception to `SQLException`.

Parameters:
  `e` - Converted Exception.
  `msgForUnknown` - Message non-convertable exception.
Returns:
  JDBC `SQLException`.
See Also:
  `IgniteQueryErrorCode`

#### convertToSqlException

    public static SQLException convertToSqlException(Exception e,
                                                     String msgForUnknown,
                                                     String sqlStateForUnknown)

Convert exception to `SQLException`.

Parameters:
  `e` - Converted Exception.
  `msgForUnknown` - Message for non-convertable exception.
  `sqlStateForUnknown` - SQLSTATE for non-convertable exception.
Returns:
  JDBC `SQLException`.
See Also:
  `IgniteQueryErrorCode`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018