Rishi Raj has Published 119 Articles

POP3 protocol client in Python

Rishi Raj

Rishi Raj

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

683 Views

The poolib module from Python's standard library defines POP3 and POP3_SSL classes. POP3 class encapsulates a connection to a POP3 server and implements the protocol as defined in RFC 1939. POP3_SSL classsupports POP3 servers that use SSL as an underlying protocol layer.POP3 protocolis obsolescent as its implementation quality of POP3 ... Read More

Interpreter base classes in Python

Rishi Raj

Rishi Raj

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

511 Views

Python's interactive mode works on the principle of REPL (Read - Evaluate - Print - Loop). The code module in Python's standard library provides classes nd convenience functions to set up REPL environment from within Python script.Following two classes are defined in code module:InteractiveInterpreter: This class deals with parsing and ... Read More

Java sql.Timestamp toString() method with example

Rishi Raj

Rishi Raj

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

7K+ Views

The toString() method of the java.sql.Timestamp class returns the JDBC escape format of the time stamp of the current Timestamp object as String variable.i.e. using this method you can convert a Timestamp object to a String.//Retrieving the Time object Timestamp timestampObj = rs.getTimestamp("DispatchTimeStamp"); //Converting the Time object to String format ... Read More

Java sql.Timestamp valueOf() method with example

Rishi Raj

Rishi Raj

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

1K+ Views

The valueOf() method of the java.sql.Timestamp class accepts a String value representing a time stamp in JDBC escape format and converts the given String value into Timestamp object.Timestamp timeStamp = Time.valueOf("timeStamp_string");ExampleLet us create a table with name dispatches_data in MySQL database using CREATE statement as shown below:CREATE TABLE dispatches_data(    ProductName VARCHAR(255),   ... Read More

Java sql.Date toString() method with example?

Rishi Raj

Rishi Raj

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

6K+ Views

The toString() method of the java.sql.Date class returns the JDBC escape format of the time of the current Date object as String variable.i.e. using this method, you can convert a Date object to a String.//Retrieving the Date object Date dateObj = rs.getDate("DispatchDate"); //Converting the Date object to String format String ... Read More

Java DatabaseMetaData getDriverMajorVersion() method with example

Rishi Raj

Rishi Raj

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

245 Views

The getDriverMajorVersion() method of the DatabaseMetaData interface returns the major version of the JDBC driver used.To get the major 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 getDriverVersion() method with example

Rishi Raj

Rishi Raj

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

353 Views

The getDriverVersion() method of the DatabaseMetaData interface returns the version of the JDBC driver used.To get the 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 object of the ... Read More

Java ResultSet previous() method with example

Rishi Raj

Rishi Raj

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

2K+ 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

Override the toString() method in a Java Class

Rishi Raj

Rishi Raj

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

5K+ Views

A string representation of an object can be obtained using the toString() method in Java. This method is overridden so that the object values can be returned.A program that demonstrates this is given as follows:Example Live Democlass Student {    private int rno;    private String name;    public Student(int r, ... Read More

Initializer for final static field in Java

Rishi Raj

Rishi Raj

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

1K+ Views

The final static field variable is a constant variable. There is only one copy of this variable available. It is mandatory to initialize the final static field variable explicitly as the default value for it is not provided by the JVM. Also, this variable cannot be reinitialized.A program that initializes ... Read More

Advertisements