![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e286. Listing the Numeric Functions Supported by a DatabaseThis example gets a list of numeric functions that a database supports.try { DatabaseMetaData dbmd = connection.getMetaData(); // Get the list of numeric functions String[] numericFunctions = dbmd.getNumericFunctions().split(",\\s*"); } catch (SQLException e) { }Examples in an Oracle database include: ABS, CEIL, COS, COSH, EXP, FLOOR, LN, LOG, MOD, POWER, ROUND, SIGN, SIN, SINH, SQRT, TAN, TANH, TRUNC, AVG, COUNT, GLB, LUB, MAX, MIN, STDDEV, SUM, VARIANCEExamples in a MySQL database include: ABS,ACOS,ASIN,ATAN,ATAN2,BIT_COUNT,CEILING,COS,COT,DEGREES,EXP, FLOOR,LOG,LOG10,MAX,MIN,MOD,PI,POW,POWER,RADIANS,RAND,ROUND,SIN, SQRT,TAN,TRUNCATE
e285. Listing the String 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. |