NetSuite Data Provider - Online Help
NetSuite Data Provider
Questions / Feedback?

Querying the Data

The RSSBus JDBC Driver for NetSuite follows the JDBC convention: First, load the NetSuite driver class. Then, make a connection. Finally, execute the query to retrieve the data from the ResultSet.

Load the Driver

Note: This step is optional per the JDBC 4.0 specification.
Class.forName("rssbus.jdbc.netsuite.NetSuiteDriver");

Establish a Connection

To establish a connection, you must prepare a connection string. The connection string must start with "jdbc:netsuite:" and may include any connection property. A typical connection string looks like "jdbc:netsuite:Account Id=XABC123456;Password=password;User=user;Role Id=3;Version=2013_1;Location=C:\\myfolder\\;". The connection string can be used with the DriverManager.getConnection method to obtain a connection object.

Connection conn = DriverManager.getConnection("jdbc:netsuite:Account Id=XABC123456;Password=password;User=user;Role Id=3;Version=2013_1;Location=C:\\myfolder\\;");
Alternatively, you may prepare the connection options using the Properties object; pass it to the DriverManager.
Properties prop = new Properties();
prop.setProperty("User","XXX");
prop.setProperty("Password","YYY");
prop.setProperty("Location","ZZZ");
Connection conn = DriverManager.getConnection("jdbc:netsuite:",prop);

Create a Statement


Statement stat = conn.createStatement();

Execute the Query

The example below selects the InternalId and AcctName columns of the Account table.

boolean ret = stat.execute("SELECT InternalId, AcctName FROM Account");
ResultSet rs=stat.getResultSet();
while(rs.next()){
  for(int i=1;i<=rs.getMetaData().getColumnCount();i++)
  {
    System.out.println(rs.getMetaData().getColumnName(i) +"="+rs.getString(i));
  }
}
You can also use the Statement object to execute an INSERT, UPDATE, or DELETE statement. The example below updates the InternalId and AcctName columns of the Account table.
stat.execute("UPDATE Account SET InternalId = 'XXX' , AcctName = 'YYY'");
int count=stat.getUpdateCount();
System.out.println(count+" rows are affected");

Supported SQL Syntax

The driver supports a restricted subset of the SQL syntax. See SELECT Statements for details.

 
 
Copyright (c) 2015 RSSBus, Inc. - All rights reserved.
Build 1.0.5577.0