If database support transaction : Metadata DB Info « Database SQL JDBC « Java






If database support transaction

   
 
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;

public class Main {
  private static final String DRIVER = "com.mysql.jdbc.Driver";

  private static final String URL = "jdbc:mysql://localhost/yourDatabase";

  private static final String USERNAME = "root";

  private static final String PASSWORD = "";

  public static void main(String[] args) throws Exception {
    Class.forName(DRIVER);
    Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
    DatabaseMetaData metadata = connection.getMetaData();

    boolean isSupportTransaction = metadata.supportsTransactions();
    System.out.println("Support Transaction = " + isSupportTransaction);
    connection.close();
  }
}

   
    
    
  








Related examples in the same category

1.Get all key words in database
2.Get Database Schema From MetaData
3.Get Catalog From Database Metadata
4.Is statement pooling supported?
5.Database MetaData: Database version
6.Type info in database metadata
7.A database MetaData query
8.DatabaseMetaData class to obtain information about the
9.Database Info
10.JDBC Performance
11.Driver Property Info
12.If database support scrollable result sets
13.Get database product information
14.Get data types supported by database
15.If database support batch update
16.Get database maximum table name length
17.Get numeric functions supported by database
18.Get JDBC driver information
19.Get system functions supported by database?
20.Get the max concurrent connection to a database?
21.Get date time functions supported by database
22.Get column names of a table using ResultSetMetaData
23.Get column's precision and scale value?
24.Get string functions supported by database?
25.JDBC Version App
26.Listing All Non-SQL92 Keywords Used by a Database
27.Listing the String Functions Supported by a Database: retrieves a list of string functions that a database supports.
28.Listing the Numeric Functions Supported by a Database
29.Listing the System Functions Supported by a Database
30.Listing the Time and Date Functions Supported by a Database
31.Getting the Maximum Table Name Length allowed in a Database
32.Detect if a table exists
33.This program uses metadata to display arbitrary tables in a database.