import java.sql.*;
public class JavaBeanConnectivityTest
{
private Connection m_Connection;
private ResultSet m_CustomerResultSet;
public JavaBeanConnectivityTest() throws Exception
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sJdbcURL = "jdbc:odbc:Xtreme Sample Database 10";
m_Connection = DriverManager.getConnection(sJdbcURL);
}
public Connection getConnection()
{
return m_Connection;
}
public ResultSet getCustomerResultSet() throws SQLException
{
Statement oStatement;
String sQuery;
sQuery = "Select [Customer ID], [Customer Name], [Last Year's Sales] from Customer";
oStatement = m_Connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
m_CustomerResultSet = oStatement.executeQuery(sQuery);
return m_CustomerResultSet;
public void setCustomerResultSet(java.sql.ResultSet newResultSet)
{
m_CustomerResultSet = newResultSet;
}
public void setOrdersResultSet(ResultSet newResultSet)
{
m_OrdersResultSet = newResultSet;
}
}
|
Business Objects, an SAP company http://www.businessobjects.com/ Support services http://www.businessobjects.com/services/support/ Product Documentation on the Web http://support.businessobjects.com/documentation/ |