BBJSP SQLTags (Deprecated)

The BBJSP system is deprecated. For new development, use BBxServlet.


In BBj 16.0 and higher, the BBJSP SQL library provides a common set of tags that can be used to access a database within the BBJSP framework.


Tag libraries need specifically importing into a BBJSP page by using the taglib directive. Here's an example of how to register this tag library in your page:

<%@ taglib uri='/WEB-CFG/tld/sql.tld' prefix='sql' %>

The uri points to the tag library definition within the web application and the prefix defines how the tag will be prefixed in the markup.


Tag Name


Param Passes parameters into an <SQL.Query> tag.
Query Executes an SQL query


<!DOCTYPE html/>
<%@ taglib uri='/WEB-CFG/tld/core.tld' prefix='c' %>
<%@ taglib uri='/WEB-CFG/tld/sql.tld' prefix='sql' %>
<!-- Demo of executing an SQL query -->
<title>SQL Tags</title>
table {border:2px solid black;text-indent: 4px;padding:0px;border-spacing: 0px;}
th{border:0px;border-bottom:2px solid black;padding:4px;background-color:ABFBFF;}
.l {border-left:1px solid black;}
<sql:query template='tpl' var='result' datasource='ChileCompany' sql='SELECT * FROM SALESREP' />

<table width='100%'>
<th align='left'>Code</th>
<th align='left' class='l'>Name</th>
<th align='left' class='l' colspan='4'>Address</th>
<th align='left' class='l'>Phone</th>
<c:iterate data="${result}" id="item" >
<c:template id='theRecord' template='${tpl}' data='${item}' />
<td class='l'>${theRecord['NAME']}</td>
<td class='l'>${theRecord['ADDRESS']} ${theRecord['ADDRESS2']}</td>
<td class='l'>${theRecord['PHONE']}</td>

<h3>The Query</h3>
<p><code>SELECT * FROM SALESREP</code></p>

<h3>The Template</h3>
<textarea rows="3" cols="100">${tpl}</textarea>

<h3>The RAW data</h3>
<textarea rows="9" cols="100">${result}</textarea>


See Also


BBJSP Tag Libraries