Arushi has Published 141 Articles

Java sql.Date valueOf() method with example

Arushi

Arushi

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

4K+ Views

The valueOf() method of the java.sql.Date class accepts a String value representing a date in JDBC escape format (yyyy-mm-dd) and convertsthe given String value into Date object.Date date = Date.valueOf("date_string");ExampleLet us create a table with name dispatches in MySQL database using CREATE statement as follows −CREATE TABLE dispatches(    ProductName ... Read More

How to reorder the columns of a table in JDBC?

Arushi

Arushi

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

275 Views

You can reorder the columns of a table in MySQL database using the ALTER TABLE command.SyntaxALTER TABLE table_name MODIFY column_name datatype AFTER another_columnAssume we have a table named dispatches_data in the database with 7 columns namely ProductName, CustomerName, DispatchDate, DeliveryTime, Price, Location and, ID with description as −//Retrieving the Time object ... Read More

Java DatabaseMetaData getDatabaseMajorVersion() method with example

Arushi

Arushi

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

301 Views

The getDatabaseMajorVersion() method of the DatabaseMetaData interface returns the major version of the underlying database in integer format.To get major version of the underlying database −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 ... Read More

Java DatabaseMetaData getColumns() method with example

Arushi

Arushi

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

4K+ Views

This method retrieves the description of the columns of a table. It accepts 4 parameters −catalog - A string parameter representing the name (or, name pattern) of the catalog (database in general) in which the table (that contains the columns of which you need to retrieve the description about) exists. ... Read More

Java DatabaseMetaData getDefaultTransactionIsolation() method with example

Arushi

Arushi

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

165 Views

In a database system where more than one transaction is being executed simultaneously and in parallel, the property of isolation states that all the transactions will be carried out and executed as if it is the only transaction in the system. No transaction will affect the existence of any other ... Read More

Java DatabaseMetaData getDriverMinorVersion() method with example

Arushi

Arushi

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

118 Views

The getDriverMinorVersion() method of the DatabaseMetaData interface returns the minor version of the JDBC driver used.To get the minor version of the JDBC driver used to connect with the database −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an ... Read More

Java DatabaseMetaData getJDBCMinorVersion() method with example

Arushi

Arushi

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

68 Views

The getJDBCMinorVersion() method of the DatabaseMetaData interface returns the minor version of the JDBC driver in integer format.To get the major version of the JDBC driver −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 ... Read More

Java DatabaseMetaData getTables() method with example

Arushi

Arushi

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

4K+ Views

This method retrieves the description of the tables available in the specified database/catalog. It accepts 4 parameters −catalog   − A string parameter representing the name (or, name pattern) of the catalog (database in general) in which the table (that contains the columns of which you need to retrieve the ... Read More

Java ResultSet moveToInsertRow() method with example

Arushi

Arushi

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

1K+ Views

When we execute certain SQL queries (SELECT query in general) they return tabular data.The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface ... Read More

Java ResultSet last() method with example

Arushi

Arushi

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

3K+ Views

When we execute certain SQL queries (SELECT query in general) they return tabular data.The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in ... Read More

Advertisements