Found 4336 Articles for Java 8

Java DatabaseMetaData supportsSavepoints() method with example

Vikyath Ram
Updated on 30-Jul-2019 22:30:26

32 Views

The supportsSavepoints() method of the DatabaseMetaData interface is used to determine whether the underlying database supports savepoints.This method returns a boolean value which is −True, when the underlying database supports savepoints.False, when the underlying database doesn't support savepoints.To determine whether the underlying database supports save points −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() method of the DriverManager class. Pass the URL the database and, user name, password of a user in the ... Read More

Java ResultSetMetaData isAutoIncrement() method with example

Arushi
Updated on 30-Jul-2019 22:30:26

198 Views

The is AutoIncrement() method of the ResultSetMetaData (interface) determines whether a particular column in the current ResultSet object is automatically numbered.This method accepts an integer value representing the index of a column and, returns a boolean value which is −True, if the specified column is automatically numbered.False, if the specified column is not automatically numbered.To get the ResultSetMetaData object, you need to −Register the Driver: Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by ... Read More

Java ResultSetMetaData getTableName() method with example.

Rishi Raj
Updated on 30-Jul-2019 22:30:26

697 Views

The getTableName() method of the ResultSetMetaData (interface) retrieves and displays the name of the table which contains the given column.This method accepts an integer value representing the index of a column and, returns a String value representing the name of the table that contains the given column.To get the ResultSetMetaData object, you need to −Register the Driver: Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by passing the URL of the database, user-name and ... Read More

Java ResultSetMetaData getColumnType() method with example

Arushi
Updated on 30-Jul-2019 22:30:26

4K+ Views

The getColumnType() method of the ResultSetMetaData (interface) retrieves the type of the specified column in the current ResultSet object.This method accepts an integer value representing the index of a column and, returns an integer value representing the SQL type of the specified column.Following is the list of values returned by various datatypes of java.sql.Type −Array: 2003Big int: -5Binary: -2Bit: -7Blob: 2004Boolean: 16Char: 1Clob: 2005Date: 91Datalink70Decimal: 3Distinct: 2001Double: 8Float: 6Integer: 4JavaObject: 2000Long var char: -16Nchar: -15NClob: 2011Varchar: 12VarBinary: -3Tiny int: -6Time stamt with time zone: 2014Timestamp: 93Time: 92Struct: 2002SqlXml: 2009Smallint: 5Rowid: -8Refcursor: 2012Ref: 2006Real: 7Nvarchar: -9Numeric: 2Null: 0Smallint: 5To get the ResultSetMetaData ... Read More

Java ResultSetMetaData getScale() method with example

Arushi
Updated on 30-Jul-2019 22:30:26

306 Views

The getScale() method of the ResultSetMetaData (interface) retrieves the number of digits after the right of the decimal point in the given column.This method accepts an integer value representing the index of a column. and returns an integer value representing the number of digits after the decimal in the specified column.To get the ResultSetMetaData object, you need to −Register the Driver: Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by passing the URL of ... Read More

Java ResultSetMetaData getColumnTypeName() method with example

Vikyath Ram
Updated on 30-Jul-2019 22:30:26

731 Views

The getColumnTypeName() method of the ResultSetMetaData (interface) retrieves and returns the name of the datatype of the specified column in the current ResultSet object.This method accepts an integer value representing the index of a column and, returns a String value representing the name of the SQL data type of the specified column.To get the ResultSetMetaData object, you need to −Register the Driver: Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by passing the URL ... Read More

Java ResultSetMetaData getPercision() method with example

Rishi Raj
Updated on 30-Jul-2019 22:30:26

195 Views

The getPercision() method of the ResultSetMetaData (interface) retrieves the size of the specified column in the current ResultSet object.This method accepts an integer value representing the index of a column and, returns an integer value representing the size of the given column.To get the ResultSetMetaData object, you need to −Register the Driver: Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by passing the URL of the database, username and password of a user in ... Read More

Java ResultSetMetaData getCatalogName() method with example

Rishi Raj
Updated on 30-Jul-2019 22:30:26

151 Views

In general a catalog is a directory which holds information about data sets, file or, a database. Whereas, in a database, catalog holds the list of all the databases, base tables, views (virtual tables), synonyms, value ranges, indexes, users, and user groups.The getCatalogName() method of the ResultSetMetaData (interface) retrieves the name of the catalog of the table containing a particular column.This method accepts an integer value representing the index of the column in the current ResultSet object, as an argument and, returns a String value representing the name of the catalog.To get the ResultSetMetaData object, you need to −Register the Driver: Select the ... Read More

Java ResultSetMetaData getColumnDisplaySize() method with example

Vikyath Ram
Updated on 30-Jul-2019 22:30:26

388 Views

The getColumnDisplaySize() method of the ResultSetMetaData (interface) retrieves the display size of a particular column.This method returns an integer value representing the display size of the column.To get the ResultSetMetaData object, you need to −Register the Driver: Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by passing the URL of the database, username and password of a user in the database (in string format) as parameters to the getConnection() method of the DriverManager ... Read More

Java ResultSetMetaData getColumnLabel() method with example

Rishi Raj
Updated on 30-Jul-2019 22:30:26

450 Views

The getColumnLabel() method of the ResultSetMetaData (interface) retrieves the display name of a particular column.This method accepts an integer value representing the index of the column in the current ResultSet object, as an argument and, returns a String value representing the label of the specified column.To get the ResultSetMetaData object, you need to:Register the Driver: Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by passing the URL of the database, username and password of ... Read More

Advertisements