%@ taglib prefix="sql" uri="http://java.sun.com/jstl/ea/sql" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/ea/core" %>
JSTL: SQL action examples
SQL Direct Query Execution
This example demonstrates how the row and columns can be directly accessed using various direct mechanisms.
create table mytable (
nameid int primary key,
name varchar(80)
)
INSERT INTO mytable VALUES (1,'Paul Oakenfold')
INSERT INTO mytable VALUES (2,'Timo Maas')
INSERT INTO mytable VALUES (3,'Paul van Dyk')
SELECT * FROM mytable
Using the Row index and Column name
Row[0].get('nameid'):
Row[0].get('name'):
Row[1].get('nameid'):
Row[1].get('name'):
Row[2].get('nameid'):
Row[2].get('name'):
Using the Row index and Column object
Row[0]Cols[0]:
Row[0]Cols[1]:
Row[1]Cols[0]:
Row[1]Cols[1]:
Row[2]Cols[0]:
Row[2]Cols[1]:
Using the Row and Column indexes
Row[0].get(0):
Row[0].get(1):
Row[1].get(0):
Row[1].get(1):
Row[2].get(0):
Row[2].get(1):
Getting the MetaData from the Column Object
Col[0]MetaData:
Col[1]MetaData:
drop table mytable