Listing the Time and Date Functions Supported by a Database : DatabaseMetadata « Database « Java Tutorial

Java Tutorial
1. Language
2. Data Type
3. Operators
4. Statement Control
5. Class Definition
6. Development
7. Reflection
8. Regular Expressions
9. Collections
10. Thread
11. File
12. Generics
13. I18N
14. Swing
15. Swing Event
16. 2D Graphics
17. SWT
18. SWT 2D Graphics
19. Network
20. Database
21. Hibernate
22. JPA
23. JSP
24. JSTL
25. Servlet
26. Web Services SOA
27. EJB3
28. Spring
29. PDF
30. Email
31. J2ME
32. J2EE Application
33. XML
34. Design Pattern
35. Log
36. Security
37. Apache Common
38. Ant
39. JUnit
Java
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Tutorial » Database » DatabaseMetadata 
20. 30. 18. Listing the Time and Date Functions Supported by a Database
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.util.Arrays;

public class Main {
  public static void main(String[] argvthrows Exception {
    String driverName = "com.jnetdirect.jsql.JSQLDriver";
    Class.forName(driverName);

    String serverName = "127.0.0.1";
    String portNumber = "1433";
    String mydatabase = serverName + ":" + portNumber;
    String url = "jdbc:JSQLConnect://" + mydatabase;
    String username = "username";
    String password = "password";

    Connection connection = DriverManager.getConnection(url, username, password);
    DatabaseMetaData dbmd = connection.getMetaData();

    // Get the list of time and date functions
    String timedateFunctions[] = dbmd.getTimeDateFunctions().split(",\\s*");
    Arrays.toString(timedateFunctions);

  }
}
20. 30. DatabaseMetadata
20. 30. 1. Database Metadata
20. 30. 2. Get Table Names from a Database
20. 30. 3. Get View Names from a Database
20. 30. 4. Get Table and View Names from a Database
20. 30. 5. DatabaseMetaData Methods for Database Information
20. 30. 6. Get Database information from DatabaseMetaData
20. 30. 7. DatabaseMetaData Methods for Information on the Database's Supported Features
20. 30. 8. DatabaseMetaData Methods for Information on the Database's Limitations
20. 30. 9. Display Database Limitation for your connection
20. 30. 10. DatabaseMetaData Methods for Information on the Database's Contents
20. 30. 11. Display Database contents for current connection
20. 30. 12. Get table information from DatabaseMetaData
20. 30. 13. Get procedure information from DatabaseMetaData
20. 30. 14. Listing All Non-SQL92 Keywords Used by a Database
20. 30. 15. Listing the String Functions Supported by a Database: retrieves a list of string functions that a database supports.
20. 30. 16. Listing the Numeric Functions Supported by a Database
20. 30. 17. Listing the System Functions Supported by a Database
20. 30. 18. Listing the Time and Date Functions Supported by a Database
20. 30. 19. Getting the Maximum Table Name Length allowed in a Database
20. 30. 20. Listing Available SQL data Types Used by a Database
20. 30. 21. Get system functions supported by database
20. 30. 22. Get the max concurrent connection to a database
20. 30. 23. Get database maximum table name length
20. 30. 24. Get numeric functions supported by database
20. 30. 25. If database support batch update
20. 30. 26. Get data types supported by database
20. 30. 27. Get date time functions supported by database
20. 30. 28. Detect if a table exists
20. 30. 29. Get string functions supported by database
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.