Package org.monetdb.monetdbe
Class MonetTypes
java.lang.Object
org.monetdb.monetdbe.MonetTypes
public class MonetTypes extends Object
Helper class to convert between MonetDBe types, JDBC SQL types and Java classes.
-
Constructor Summary
Constructors Constructor Description MonetTypes() -
Method Summary
Modifier and Type Method Description protected static booleanconvertTojavaClass(int monetdbetype, Class<?> javaClass)Determines if the MonetDBe type can be converted to the Java classprotected static Class<?>getClassForMonetType(int monetdbeType)Conversion between MonetDBe type (int) and Java classes (Class)protected static Class<?>getClassForSQLType(int sqlType)Conversion between SQL types (int) and Java classes (Class)protected static intgetDefaultSQLTypeForClass(Class<?> javaClass)Conversion between Java classes (Class) and SQL types (int)protected static intgetMonetSize(int monetdbetype)Returns the size of the MonetDBe type in bytes.protected static intgetMonetTypeFromSQL(int sqltype)Conversion between SQL types (int) and MonetDBe types (int)protected static intgetMonetTypeIntFromSQLName(String sqlTypeName)Conversion between SQL types (String) and MonetDBe types (int)protected static StringgetMonetTypeString(int monetdbetype)Returns the String name for the MonetDBe type (int)protected static intgetPrecision(int sqlType)Retrieves the maximum column size for a given SQL type.protected static intgetSQLIntFromSQLName(String sqlTypeName)Returns the SQL type int from a SQL type name (String)protected static intgetSQLTypeFromMonet(int monetdbetype)Conversion between MonetDBe types (int) and SQL types (int)protected static StringgetSQLTypeNameFromMonet(int monetdbetype)Conversion between MonetDBe types (int) and SQL types (String)protected static booleanisSigned(int sqlType)Returns if the SQL type is signed.
-
Constructor Details
-
MonetTypes
public MonetTypes()
-
-
Method Details
-
getSQLTypeFromMonet
protected static int getSQLTypeFromMonet(int monetdbetype)Conversion between MonetDBe types (int) and SQL types (int)- Parameters:
monetdbetype- MonetDBe type (int) to convert- Returns:
- SQL type (int)
-
getSQLTypeNameFromMonet
Conversion between MonetDBe types (int) and SQL types (String)- Parameters:
monetdbetype- MonetDBe type (int) to convert- Returns:
- SQL type (String)
-
getMonetTypeFromSQL
protected static int getMonetTypeFromSQL(int sqltype)Conversion between SQL types (int) and MonetDBe types (int)- Parameters:
sqltype- SQL type (int) to convert- Returns:
- MonetDBe type (int)
-
getMonetTypeIntFromSQLName
Conversion between SQL types (String) and MonetDBe types (int)- Parameters:
sqlTypeName- SQL type (String) to convert- Returns:
- MonetDBe type (int)
-
getClassForSQLType
Conversion between SQL types (int) and Java classes (Class)- Parameters:
sqlType- SQL type (int) to convert- Returns:
- Java class
-
getDefaultSQLTypeForClass
Conversion between Java classes (Class) and SQL types (int)- Parameters:
javaClass- Java class to convert- Returns:
- Default SQL type (int) for Java class
-
convertTojavaClass
Determines if the MonetDBe type can be converted to the Java class- Parameters:
monetdbetype- MonetDBe type to convertjavaClass- Java class to be converted to- Returns:
- true if the type can be converted to the class, false otherwise
-
getClassForMonetType
Conversion between MonetDBe type (int) and Java classes (Class)- Parameters:
monetdbeType- MonetDBe type (int) to convert- Returns:
- Java class
-
getMonetTypeString
Returns the String name for the MonetDBe type (int)- Parameters:
monetdbetype- MonetDBe type (int)- Returns:
- Name of the MonetDBe type
-
getMonetSize
protected static int getMonetSize(int monetdbetype)Returns the size of the MonetDBe type in bytes. Only works for static lenght types.- Parameters:
monetdbetype- MonetDBe type (int)- Returns:
- Size of the MonetDBe type
-
getSQLIntFromSQLName
Returns the SQL type int from a SQL type name (String)- Parameters:
sqlTypeName- SQL type (String)- Returns:
- SQL type (int)
-
isSigned
protected static boolean isSigned(int sqlType)Returns if the SQL type is signed.- Parameters:
sqlType- SQL type (int)- Returns:
- true if the SQL type can be signed, false otherwise
-
getPrecision
protected static int getPrecision(int sqlType)Retrieves the maximum column size for a given SQL type.- Parameters:
sqlType- SQL type (int)- Returns:
- type precision
-