Package virtuoso.jdbc4

## Class VirtuosoException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.sql.SQLException
      - - virtuoso.jdbc4.VirtuosoException

    public class VirtuosoException
    extends java.sql.SQLException

This class is an SQLException that has special constructors for messages directly from Virtuoso.

All classes can thrown a such exception.

See Also:
  `SQLException`, Serialized Form

### Field Summary

Fields
`static int` `BADFORMAT` This error code is returned if a user input should be a numeric, but he not entered one.
`static int` `BADLOGIN` Bad login.
`static int` `BADPARAM` Bad parameters given to the function.
`static int` `BADTAG` Error occurred on a DV tag.
`static int` `CASTERROR` Cast error occurred on an object.
`static int` `CLOSED` Error occurred when a function is called in a class which is previously closed.
`static int` `DISCONNECTED` The client is not connected to the database or the DBMS disconnected it.
`static int` `EOF` Error returned when a end of stream is reached.
`static int` `ERRORONTYPE` Error occurred when a method is not compatible with the type.
`static int` `ILLJDBCURL` The JDBC url given is not valid.
`static int` `IOERROR` An I/O error occurred due to a communication problem on the socket layer.
`static int` `MISCERROR` Returned when a trivial error occurred.
`static int` `NOLICENCE` Error returned when your license is not valid.
`static int` `NOTIMPLEMENTED` Method launched is not implemented yet.
`static int` `OK` The operation ran with success.
`static int` `SQLERROR` Error code which represents a SQL error done by the Virtuoso DBMS.
`static int` `TIMEOUT` Time out detected during a query.
`static int` `UNKNOWN` Returned when an unknown error is occurred.

### Constructor Summary

Constructors
`VirtuosoException​(java.lang.Exception e, int vendor)` Constructs a VirtuosoException based on some odd exception.
`VirtuosoException​(java.lang.Exception e, java.lang.String data, int vendor)`
`VirtuosoException​(java.lang.String data, int vendor)` Constructs a VirtuosoException based on an error occurred from Virtuoso.
`VirtuosoException​(java.lang.String data, java.lang.String sqlstate, int vendor)` Constructs a VirtuosoException based on an error occurred from Virtuoso and an SQL state.

### Method Summary

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

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

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

### Methods inherited from class java.sql.SQLException

`getErrorCode, getNextException, getSQLState, iterator, setNextException`

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

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Field Detail

#### OK

    public static final int OK

The operation ran with success. Normally, this error code (which is not one) is never used. It's just in case of we need a such return code.

See Also:
  Constant Field Values

#### DISCONNECTED

    public static final int DISCONNECTED

The client is not connected to the database or the DBMS disconnected it.

See Also:
  Constant Field Values

#### ILLJDBCURL

    public static final int ILLJDBCURL

The JDBC url given is not valid. A URL under the Virtuoso DBMS JDBC driver should be :

       jdbc:virtuoso://host:port , or
       jdbc:virtuoso://host:port/UID=username/PWD=userpassword

See Also:
  Constant Field Values

#### IOERROR

    public static final int IOERROR

An I/O error occurred due to a communication problem on the socket layer.

See Also:
  Constant Field Values

#### BADPARAM

    public static final int BADPARAM

Bad parameters given to the function.

See Also:
  Constant Field Values

#### BADLOGIN

    public static final int BADLOGIN

Bad login. Error code returned if the user name or/and password given are not valid.

See Also:
  Constant Field Values

#### TIMEOUT

    public static final int TIMEOUT

Time out detected during a query.

See Also:
  Constant Field Values

#### NOTIMPLEMENTED

    public static final int NOTIMPLEMENTED

Method launched is not implemented yet. Some function in the JDBC API are optional, so if one of these is not implemented, a such error is returned.

See Also:
  Constant Field Values

#### SQLERROR

    public static final int SQLERROR

Error code which represents a SQL error done by the Virtuoso DBMS.

See Also:
  Constant Field Values

#### BADTAG

    public static final int BADTAG

Error occurred on a DV tag. A such error does not occur. It's only returned if the Virtuoso DBMS used with the currently driver is too recent. It's reserved for futures cases.

See Also:
  Constant Field Values

#### CASTERROR

    public static final int CASTERROR

Cast error occurred on an object. A such error does not occur. It's only returned if the Virtuoso DBMS used with the currently driver is too recent. It's reserved for futures cases.

See Also:
  Constant Field Values

#### BADFORMAT

    public static final int BADFORMAT

This error code is returned if a user input should be a numeric, but he not entered one. Especially if the port number is not a number.

See Also:
  Constant Field Values

#### ERRORONTYPE

    public static final int ERRORONTYPE

Error occurred when a method is not compatible with the type.

See Also:
  Constant Field Values

#### CLOSED

    public static final int CLOSED

Error occurred when a function is called in a class which is previously closed. E.g. you want to access to Connection.getMetaData function but you did a Connection.close before.

See Also:
  Constant Field Values

#### EOF

    public static final int EOF

Error returned when a end of stream is reached.

See Also:
  Constant Field Values

#### NOLICENCE

    public static final int NOLICENCE

Error returned when your license is not valid.

See Also:
  Constant Field Values

#### UNKNOWN

    public static final int UNKNOWN

Returned when an unknown error is occurred. It should not occur, but just in case of...

See Also:
  Constant Field Values

#### MISCERROR

    public static final int MISCERROR

Returned when a trivial error occurred.

See Also:
  Constant Field Values

### Constructor Detail

#### VirtuosoException

    public VirtuosoException​(java.lang.String data,
                             int vendor)

Constructs a VirtuosoException based on an error occurred from Virtuoso.

Parameters:
  `data` - The error message.
  `vendor` - The error code vendor.

#### VirtuosoException

    public VirtuosoException​(java.lang.Exception e,
                             java.lang.String data,
                             int vendor)

#### VirtuosoException

    public VirtuosoException​(java.lang.String data,
                             java.lang.String sqlstate,
                             int vendor)

Constructs a VirtuosoException based on an error occurred from Virtuoso and an SQL state.

Parameters:
  `data` - The error message.
  `sqlstate` - The SQL state of the error.
  `vendor` - The error code vendor.

#### VirtuosoException

    public VirtuosoException​(java.lang.Exception e,
                             int vendor)

Constructs a VirtuosoException based on some odd exception.

Parameters:
  `e` - The exception that caused this to be thrown.
  `vendor` - The error code vendor.