%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="netcharts.server.api.*" %>
<%@ page import="netcharts.server.util.*" %>
<%
/*
*** Netcharts Server API functions ***
The NDS API functions are provided to simplify functions where data
manipulation is required, or when a manual data layout is required.
Parameters can be passed at runtime using a hashtable
*/
NSWebToolKit toolKit = new NSWebToolKit("MMODev/Testbed");
Hashtable ndsHashtable1 = new Hashtable();
// ndsHashtable1.put("columnSort","0");
String dataVectorElement1 = null;
StringBuffer dataBuffer1 = null;
try
{
Vector dataVector1 = toolKit.getNDSDataAsVector("TEST_Testbed.ndx",
ndsHashtable1);
dataVectorElement1 = (String)dataVector1.elementAt(0);
Object dataArray1[][] = toolKit.getNDSData("TEST_Testbed.ndx",
ndsHashtable1);
dataBuffer1 = new StringBuffer();
for (int i=0; i < dataArray1.length; i++)
{
dataBuffer1.append((dataArray1[i][0]).toString());
}
}
catch (Exception ex)
{
System.out.println(netcharts.server.util.Util.formatForHtml
(ex.getMessage()));
dataVectorElement1 = "";
dataBuffer1 = new StringBuffer();
}
%>
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");
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";
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();
%>