Generate XML with JSTL and SQL

from http://krook.net/archives/210 <%@ page contentType=“text/xml; charset=UTF-8″ pageEncoding=“UTF-8″ session=“false”%> <?xml version=“1.0″ encoding=“UTF-8″ ?> <%@ taglib prefix=“sql” uri=“http://java.sun.com/jsp/jstl/sql” %><%@ taglib prefix=“c” uri=“http://java.sun.com/jsp/jstl/core” %> <sql:setDataSource dataSource=“jdbc/yourdatasource”/> <sql:query var=“items”>  SELECT ID id, TITLE title, ABSTRACT abstract, BODY body, THUMBNAIL thumbnail    FROM NEWS_ARTICLES NA, NEWS_ARTICLE_IMAGES NAI    WHERE NA.ID = NAI.NA_ID;</sql:query> <results> <c:forEach var=“row” items=“${items.rows}” >  <result id=“<c:out value=”${row.id}“/>“>    […]

Read More »

JDBC Driver URL Cheat Sheet

http://www.devx.com/tips/Tip/28818 A List of JDBC Drivers If you need to access a database with Java, you need a driver. This is a list of the drivers available, what database they can access, who makes it, and how to contact them. IBM AS400 jdbc:as400://<HOST>:<PORT>/<DB> com.ibm.as400.access.AS400JDBCDriver IBM DB2 jdbc:db2://:/ COM.ibm.db2.jdbc.app.DB2Driver JDBC-ODBC Bridge jdbc:odbc: sun.jdbc.odbc.JdbcOdbcDriver Microsoft SQL Server […]

Read More »

AS400 Iseries ODBC PHP connection

$server=”iseries”; #the name of the iSeries $user=”myusr”; #a valid username that will connect to the DB $pass=”mypassword”; #a password for the username #Connect to the Database with ODBC – $conn is defined and loaded using the “odbc_connect” PHP #directive. $conn=odbc_connect($server,$user,$pass); #you may have to remove quotes #Check Connection if ($conn == false) { echo “Not […]

Read More »

seleniumhq

Selenium IDE is a Firefox add-on that makes it easy to record and playback tests in Firefox 2+. You can even use it generate code to run the tests with Selenium Remote Control.

Read More »

MediaPortal

MediaPortal is an Open Source application ideal for turning your PC / TV into a very advanced Media Center. MediaPortal allows you to listen to your favorite music & radio, watch and store your videos and DVDs, view, schedule and record live TV as a digital video recorder and much much more.

Read More »

The Science Behind Foldit

Foldit is a revolutionary new computer game enabling you to contribute to important scientific research. This page describes the science behind Foldit and how your playing can help.

Read More »

JSP page using JDBC in a scriptlet

<jsp:directive.page import=”java.sql.*” /><br /><span class=”boldcode”><jsp:scriptlet><br />Class.forName(“org.gjt.mm.mysql.Driver”);<br />Connection connection = <br /> DriverManager.getConnection(“jdbc:mysql://localhost:3306/test”, “”, “”);<br />Statement statement = connection.createStatement();<br />int changed = <br /> statement.executeUpdate(“update counters set hitCount = hitCount + 1 ” +<br /> “where page like ‘” + request.getRequestURI() + “‘”);<br />if (changed == 0) statement.executeUpdate(“insert counters(page) values(‘” +<br /> request.getRequestURI() + “‘)”);<br />ResultSet […]

Read More »