sql functions with examples

Ads
 

sql functions with examples

I need sql functions with examples to learn fast.

View Answers

April 14, 2008 at 7:20 PM

Hi friend,

<%@ page language="java" import="java.sql.*,java.util.*,java.text.*" %>
<html>
<head>
<title>Retrive value from database</title>
</head>
<body>
<table border="0" width="50%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<h2><font color="#FF0033">Retrive data from database</font></h2>
<form method="POST" >
<table border="1" width="50%" cellspacing="0" cellpadding="0" bgcolor="#CCFFFF">
<tr>
<td width="50%" valign="right"><b>User ID:</b></td>
<%
Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "register";
String driver = "com.mysql.jdbc.Driver";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"root","root");
try{
Statement st = con.createStatement();
String query = "SELECT * FROM userid where empname='amardeep'";
ResultSet rs = st.executeQuery(query);
while (rs.next()) {
%>
<td width="50%" valign="right"><%=rs.getInt("id")%><br/></td>
<tr>
<td width="50%" valign="right"><b>User Name:</b></td>
<td width="50%" valign="right"><%=rs.getString("empname")%><br/></td>
</tr>
<%}
rs.close();
con.close();
}
catch (SQLException ex){
System.out.println("SQL statement is not executed!");
}
}
catch (Exception e){
e.printStackTrace();
}
%>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>

-------------------------

Ads









Related Tutorials/Questions & Answers:
SQL Aggregate Functions First
SQL Aggregate Functions First       SQL Aggregate Function First, that performs calculation... illustrate an example from SQL Aggregate Functions First. The Example create a table
SQL Aggregate Functions In Where Clause
SQL Aggregate Functions In Where Clause       SQL Aggregate Function In Where Clause return... with Example The Tutorial help you to understand an Example from 'SQL Aggregate
Advertisements
SQL tutorial with examples
SQL tutorial with examples  Hi, I am looking for good SQL tutorial with examples code. Please give me good urls for SQL tutorial with example code which can be downloaded and easily used. Thanks   Read at SQL Example
Aggregate Functions in SQL, SQL Tutorial
Aggregate Functions       In this section we are going to illustrate aggregate function, with the help... and many more in SQL. They are briefly described and denoted by the keyword
SQL Aggregate Functions Group By
SQL Aggregate Functions Group By       SQL Aggregate Functions Group By return the aggregate... with the use of 'SQL Aggregate Functions Group By'. In this example, we
SQL Aggregate Functions
SQL Aggregate Functions       SQL Aggregate Functions is built in function that is used... illustrate an example from 'SQL Aggregate Function'. To understand and grasp
Sql Examples using php code
Here is the many examples. In this tutorial we discuss many examples of sql statements using php code
SQL Aggregate Functions Group By
SQL Aggregate Functions Group By       SQL Aggregate Functions Group By return the aggregate... with the use of 'SQL Aggregate Functions Group By'. In this example, we
SQL Aggregate Functions Where Clause
SQL Aggregate Functions Where Clause       SQL Aggregate Functions Where Clause is used to perform  various Functions like Sum, Count, Average, Maximum and Minimum. Understand
SQL Aggregate Functions List
SQL Aggregate Functions List       SQL Aggregate Functions List describe you the Aggregate Function... queries. Understand with Example The Tutorial illustrate an example from SQL
SQL Aggregate Functions Where Clause
SQL Aggregate Functions Where Clause       SQL Aggregate Functions Where Clause return you... with Example The Tutorial illustrate an example from 'SQL Aggregate Functions
SQL Aggregate Functions First
SQL Aggregate Functions First       SQL Aggregate Function First, that performs calculation... illustrate an example from SQL Aggregate Functions First. The Example create a table
SQL Aggregate Functions In Where Clause
SQL Aggregate Functions In Where Clause       SQL Aggregate Function In Where Clause return... with Example The Tutorial help you to understand an Example from 'SQL Aggregate
JPA Examples
, JPQL functions, using Eclipse IDE to develop and compile the examples. Here...JPA Examples In this section we will discuss about the examples of JPA. This section will describe you the various examples that will help you create JPA
SQL Functions
SQL Functions      ... Statement Mysql Merge Statement is used to merge the two sql statement using UNION clause.The UNION clause is used to combine the result set of any two sql
sql
difference between sql and oracle  what is the difference between sql and oracle
sql
sql  how to get first row in sql with using where condition in sql? how to get last row in sql with using where condition in sql
Inbuild functions
Inbuild functions  List all the inbuild functions in java
sql
sql  I want interview sql questions   Please visit the following link: SQL Tutorials
Sql
Sql  how to find maximum of a101,a102,a103 from a table in sql
Hibernate Criteria Aggregate Functions Example
Hibernate Criteria Aggregate Functions Example  I need Hibernate Criteria Aggregate Functions Example program with source code, I want example of Hibernate Criteria Aggregate Functions? Can anyone share me the source code
sql
sql  returning value from a store procedure in sql with example   Please visit the following links: http://www.roseindia.net/mysql/mysql5/stored-procedures-and-functions.shtml http://www.roseindia.net/sql/create
What are the prerequisites for learning SQL?
SQL Introduction SQL Date Examples SQL Functions Thanks...What are the prerequisites for learning SQL?  Hi, I want to learn SQL with the MySQL Database. I am finding some information on getting started
SQL
SQL  In my computer i have microsoft sql 2008.how can i set that in the cmd.i want to use that in cmd.what is the default username and password
SQl
SQl  . Given two tables: table1(player, groundname, numcenturies); table2(ground_name, country); Write and SQL query for the following: " Select all the players from table1 who has
SQL
SQL   1)How to Store 1000 records in Oracle object. 2)Write a query for calculate highest, 3rd Highest & 10th highest salary from emp teble. 3)What is Sequence. 4)How to use rowid in Sql. 5)What is Views. 6)How
Should I learn SQL or MySQL first
and Tutorials SQL for Beginners SQL Introduction SQL Date Examples SQL Functions...Should I learn SQL or MySQL first  Hi, I want to master database. Should I learn SQL or MySQL first? Thanks   Hi, SQL is query language
Should I learn SQL or MySQL first
and Tutorials SQL for Beginners SQL Introduction SQL Date Examples SQL Functions...Should I learn SQL or MySQL first  Hi, I want to master database. Should I learn SQL or MySQL first? Thanks   Hi, SQL is query language
SQL
SQL  how to get ( 15 march 2011) and (15/03/2011) output using SQL   Use the following queries to get the data from database in the given format. For (15 march 2011) format: SELECT DATE_FORMAT(dob, '%d %M %Y') FROM
SQL
SQL  how to get ( 15 march 2011) and (15/03/2011) output using SQL   Use the following queries to get the data from database in the given format. For (15 march 2011) format: SELECT DATE_FORMAT(dob, '%d %M %Y') FROM
SQL
SQL Trigger query  Why we use the Trigger and what it's uses?   A database trigger is procedural code that is automatically executed..., user events, and SQL statements to subscribing applications 10)Restrict DML

Ads