%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%
/*
Unlike IIS VBScript, this variable *must* be declared and initialized
before calling the Footer.inc include, even if it's supposed to be
empty.
*/
String strPageName = "";
String strQuery="Select Model_no as MajorModel, Minor_Model_no as " +
"MinorModel, " +
"Prod_Line_No as LineNumber, Cust_Variable_id as " +
"CustomerVariable, Registration_No as CallLetters, " +
"AP_Status as Delivered, Country_of_Operation_nm as " +
"RegisteredAt from brg_airplanes " +
"Where prod_line_no > '770' And active_ind = 'Y' " +
"And Substr(Model_No, 1, 3) = '757' " +
"Order by Minor_Model_no";
%>
MMO Metrics Solution Development - NetCharts Testbed Project - Oracle BRIDGE Connection Test
Oracle BRIDGE Connection Test
Below is a query from the BRIDGE systems' BRG_AIRPLANES Table.
<%
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection objConn=DriverManager.getConnection("jdbc:oracle:thin:@fremont.ca.boeing.com:1521:brgprodb", "userid", "password");
Statement objStmt = objConn.createStatement();
//This is required to access the BRIDGE system
if (objStmt.execute("CALL MMI.AUTHORIZE()"))
{
//Do nothing - if it doesn't work, investigate further
}
ResultSet objRS = objStmt.executeQuery(strQuery);
ResultSetMetaData objRSMeta = objRS.getMetaData();
int intColCount = objRSMeta.getColumnCount();
out.println("");
for(int i = 1; i <= intColCount; i++)
{
out.println("" + objRSMeta.getColumnName(i) + " | ");
}
out.println("
");
while(objRS.next())
{
out.println("");
for(int i = 1; i <= intColCount; i++)
{
out.println("" + objRS.getObject(i) + " | ");
}
out.println("
");
}
out.println("
");
objRS.close();
objConn.close();
%>
<%@ include file="../Footer.inc" %>