![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e285. Listing the String Functions Supported by a DatabaseThis example retrieves a list of string functions that a database supports.try { DatabaseMetaData dbmd = connection.getMetaData(); // Get the list of string functions String[] stringFunctions = dbmd.getStringFunctions().split(",\\s*"); } catch (SQLException e) { }Examples in an Oracle database include: CHR, INITCAP, LOWER, LPAD, LTRIM, NLS,_INITCAP, NLS,_LOWER, NLS,_UPPER, REPLACE, RPAD, RTRIM, SOUNDEX, SUBSTR, SUBSTRB, TRANSLATE, UPPER, ASCII, INSTR, INSTRB, LENGTH, LENGTHB, NLSSORT, CHARTOROWID, CONVERT, HEXTORAW, RAWTOHEX, ROWIDTOCHAR, TO_CHAR, TO_DATE, TO_LABEL, TO_MULTI_BYTE, TO_NUMBER, TO_SINGLE_BYTEExamples in a MySQL database include: ACII,CHAR,CHAR_LENGTH,CHARACTER_LENGTH,CONCAT,ELT,FIELD,FIND_IN_SET, INSERT,INSTR,INTERVAL,LCASE,LEFT,LENGTH,LOCATE,LOWER,LTRIM,MID,POSITION, OCTET_LENGTH,REPEAT,REPLACE,REVERSE,RIGHT,RTRIM,SPACE,SOUNDEX,SUBSTRING, SUBSTRING_INDEX,TRIM,UCASE,UPPER
e286. Listing the Numeric Functions Supported by a Database e287. Listing the System Functions Supported by a Database e288. Listing the Time and Date Functions Supported by a Database e289. Getting the Maximum Table Name Length in a Database e290. Listing Available SQL Types Used by a Database e291. Getting the Name of a JDBC Type © 2002 Addison-Wesley. |