Found 4336 Articles for Java 8

How to specify the encoding type used by forms that post data back to the Web application in a JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25

251 Views

The tag is used to specify the encoding type used by forms that post data back to the Web application.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultkeyName of character encoding you want to apply when decoding request parameters.YesNoneYou use the tag when you want to specify the character encoding for decoding data posted from forms. This tag must be used with character encodings that are different from ISO-8859-1. The tag is required since most browsers do not include a Content-Type header in their requests.The purpose of the tag is to specify the content type of the request. ... Read More

How to maps key to the localized message and performs the parametric replacement in a JSP?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

141 Views

The tag maps key to the localized message and performs the parametric replacement.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultkeyMessage key to retrieveNoBodybundleResource bundle to useNoDefault bundlevarName of the variable to store the localized messageNoPrint to pagescopeThe scope of the variable to store the localized messageNoPageExample JSTL fmt:message Tag You will receive the following result −One Two Three

How to handle Null values while working with JDBC?

Nancy Den
Updated on 30-Jul-2019 22:30:25

2K+ Views

SQL's use of NULL values and Java's use of null are different concepts. So, to handle SQL NULL values in Java, there are three tactics you can use:Avoid using getXXX( ) methods that return primitive data types.Use wrapper classes for primitive data types, and use the ResultSet object's wasNull( ) method to test whether the wrapper class variable that received the value returned by the getXXX( ) method should be set to null.Use primitive data types and the ResultSet object's wasNull( ) method to test whether the primitive variable that received the value returned by the getXXX( ) method should ... Read More

How can we retrieve time from a table in JDBC?

Nancy Den
Updated on 30-Jul-2019 22:30:25

332 Views

The ResultSet interface provides a method named getTime() this method accepts an integer parameter representing the index of the column, (or, a String parameter representing the name of the column) from which you need to retrieve the time value. To retrieve time value from a table −Register the driver class using the registerDriver() method of the DriverManager class. Pass the driver class name to it, as parameter.Connect to the database using the getConnection() method of the DriverManager class. Passing URL (String), username (String), password (String) as parameters to it.Create a Statement object using the createStatement() method of the Connection interface.Execute ... Read More

What are JSTL Core tags in JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25

240 Views

The core group of tags is the most commonly used JSTL tags. Following is the syntax to include the JSTL Core library in your JSP −Following table lists out the core JSTL Tags −S.No.Tag & Description1Like , but for expressions.2Sets the result of an expression evaluation in a 'scope'3Removes a scoped variable (from a particular scope, if specified).4Catches any Throwable that occurs in its body and optionally exposes it.5Simple conditional tag which evalutes its body if the supplied condition is true.6Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by and .7Subtag of that ... Read More

How can we set time in a table in JDBC?

Nancy Den
Updated on 30-Jul-2019 22:30:25

228 Views

You can insert time values in SQL using the time datatype, The java.sql.Time class maps to the SQL Time type.The PreparedStatement interface provides a method named setTime(). Using this you can insert time into a table. This method accepts two parameters −An integer representing the parameter index of the place holder (?) to which we need to set date value.A Time object representing the time value to be passed. The constructor of java.sql.Time class accepts a variable of long type representing the number of milliseconds from the epoch (standard base time I.e. January 1, 1970, 00:00:00 GMT).ExampleAssume we have created ... Read More

How to retrieve Date from a table in JDBC?

Nancy Den
Updated on 30-Jul-2019 22:30:25

4K+ Views

The ResultSet interface provides a method named getDate() this method accepts an integer parameter representing the index of the column, (or, a String parameter representing the name of the column) from which you need to retrieve the date value. To retrieve date value from a table −Register the driver class using the registerDriver() method of the DriverManager class. Pass the driver class name to it, as parameter.Connect to the database using the getConnection() method of the DriverManager class. Passing URL (String), username (String), password (String) as parameters to it.Create a Statement object using the createStatement() method of the Connection interface.Execute ... Read More

How to insert Date value into table in JDBC?

Nancy Den
Updated on 30-Jul-2019 22:30:25

6K+ Views

You can insert date values in SQL using the date datatype, The java.sql.Date class maps to the SQL DATE type.The PreparedStatement interface provides a method named setDate(). Using this you can insert date into a table. This method accepts two parameters −An integer representing the parameter index of the place holder (?) to which we need to set date value.a Date object representing the date value to be passed. The constructor of java.sql.Date class accepts a variable of long type representing the number of milliseconds from the epoch (standard base time I.e. January 1, 1970, 00:00:00 GMT).ExampleAssume we have created ... Read More

How to handle date in JDBC?

Krantik Chavan
Updated on 30-Jul-2019 22:30:25

1K+ Views

You can insert date values in SQL using the date datatype, The java.sql.Date class maps to the SQL DATE type.The PreparedStatement interface provides a method named setDate(). Using this you can insert date into a table. This method accepts two parameters −An integer representing the parameter index of the place holder (?) to which we need to set date value.a Date object representing the date value to be passed. The constructor of java.sql.Date class accepts a variable of long type representing the number of milliseconds from the epoch (standard base time I.e. January 1, 1970, 00:00:00 GMT).ExampleAssume we have created ... Read More

What are Lob Data Types? What are the restrictions on these datatypes in JDBC?

Krantik Chavan
Updated on 30-Jul-2019 22:30:25

164 Views

A BLOB is binary large object that can hold a variable amount of data with a maximum length of 65535 charactersThese are used to store large amounts of binary data, such as images or other types of files.A CLOB stands for Character Large Object in general, an SQL Clob is a built-in datatype is used to store large amount of textual data. Using this datatype, you can store data up to 2, 147, 483, 647 characters.Blob and Clob data types together are known as LOB (Large Object) datatypes. Following are the restrictions on these datatypes.Cannot compare: We cannot compare CLOB ... Read More

Advertisements