by Dinesh Thakur Category: Servlet with MySql Database

This function will also return the divided value from two expressions with a sign of division (/).

 
by Dinesh Thakur Category: Servlet with MySql Database

This function will return divided value from two expressions. The first i made a database named 'dbase' within the reference of mySql(php myAdmin). Then after i import all java packages from java library as program need. Here i made a class named 'MySqlDIVFunction' which extends 'HttpServlet'.i use service()Method that will help to getting the request from doGet()Method for output on web browser.



 
by Dinesh Thakur Category: Servlet with MySql Database

This Function will return the degree value from radian expression. I made a database first named 'dbase' within the reference of mySql(php myAdmin). Then i import all the required java packages from the java library. Here after i made a class named 'MySqlDEGREESFunction' which extends 'HttpServlet' Completely.



 
by Dinesh Thakur Category: Servlet with MySql Database

This function will use to wipe Duplicate columns and rows. The first i made a table named 'dept' with required fields and the values into a database named 'dbase' within the reference of mySql(php myAdmin). Then after i import all java packages from java library as program need. Here i made a class named 'MySqlDistnictJavaServlet' which extends 'HttpServlet'.i use service()Method that will help to getting the request from doGet()Method for output on web browser.



 
by Dinesh Thakur Category: Servlet with MySql Database

This function will return the Day of Year (1 to 365). First i made a database named 'dbase' within the reference of mySql(php myAdmin) with required fields and values in it. Then according to need of  program i import all the java packages from the java library. I create a class named 'MySqlDayOfYear' which extends 'HttpServlet'. Then i use serviceMethod() that will bring the request from doGet()Method for output on web browser.



 
by Dinesh Thakur Category: Servlet with MySql Database

This function will return the value as Day Of week (1-7). first i made a database named 'dbase' within the reference of mySql(php myAdmin).i import all the required java packages from java library according to requirement of program. Then i made a class named 'MySqlDayOfWeek' which extends 'HttpServlet'. Then after i use service()Method that will getting request from the doGet() for output on the web browser. Then after i loaded all the required drivers for database accessing.



 
by Dinesh Thakur Category: Servlet with MySql Database

To make operations on the database we should know the data formats of the database. When using a ResultSet it is possible to access metadata for the data returned from the query. To obtain an object which encapsulates this metadata, use the method getMetaData () from the ResultSet class. This method returns an object of the ResultSetMetaData class and allows us to determine the number and type of columns.



 
by Dinesh Thakur Category: Servlet with MySql Database

The package java.sql contains a number of data types for compatibility with SQL database types. Some of these types are shown in Table.



 
by Dinesh Thakur Category: Servlet with MySql Database

Java provides two levels of error conditions at which to handle exceptions thrown by JDBC statements: SQLException and SQLWarning. The SQLException class provides information on the errors that have occurred during database access. This information consists of nature of error, error message, SQL state and vendor-specific information. If SQLExceptions are not handled, the program will terminate. The SQLWarning conditions are sub-classes of the SQLException condition: these provide information on the database access warnings. These can be ignored.



 
by Dinesh Thakur Category: Servlet with MySql Database

When a database is updated with each Statement object, by default, it will automatically commit the changes (permanently) to the database immediately. In general, to complete a transaction, it is required that one or more statements be executed. Thus, there are situations where a commit statement is needed after execution of more than one statement. In Java, the Connection object performs transaction control. The Connection object provides a method setAutoCommit (boolean value) to specify whether a transaction (or a set of transactions) should commit automatically or manually. By default, it is set to auto-commit mode. The syntax for this is the following:



 
by Dinesh Thakur Category: Servlet with MySql Database

Java database connectivity defines a set of API objects and methods to communicate with databases. In the process of communicating with databases, a Java program does the following:



 
by Dinesh Thakur Category: Servlet with MySql Database

Java database connectivity is essential for building stand-alone database applications and also for developing dynamic Java-based web applications. Before working with JDBC, it is required to install Java, a JDBC driver and the DBMS on the computer systems. Usually, the JDBC—ODBC bridge driver is bundled with the JDK.



 
by Dinesh Thakur Category: Servlet with MySql Database

Below Figure is a representative sketch of the JDBC architecture. This can be used in Java applications,applets, servlets or any other program where Java codes used. Java codes only interact with theJDBC Application-Program Interface (API). The JDBC API is a simple SQL-Level interface,which allows execution of SQL statements through Java.



 
by Dinesh Thakur Category: Servlet with MySql Database

JDBC defines an API designed to support basic SQL functionality independent of any specific SQL implementation. This means the focus is on executing SQL statements and retrieving their results.



 
by Dinesh Thakur Category: Servlet with MySql Database

ODBC (open database connectivity) is an open specification given by x-open company that contains a set of rules and guidelines to develop ODBC drivers for different.



 
by Dinesh Thakur Category: Servlet with MySql Database

Servlets are the server-side components that enhance the capability of Java-enabled servers and allow a variety of network-based services. For example, servlets with the database communication can facilitate solutions for distributed applications.



 
by Dinesh Thakur Category: Servlet with MySql Database

This function will return the Value of Month's Day in Numeric value (1 to 31).

 
by Dinesh Thakur Category: Servlet with MySql Database

The Function 'DAY NAME' will show the day's Name of the Month.

 
by Dinesh Thakur Category: Servlet with MySql Database

The Function 'DATE_SUB' will subtract the date with required Interval.

 
by Dinesh Thakur Category: Servlet with MySql Database

The function 'DATE' will show the present date of system.

 

Page 9 of 12



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.