Available only for Java and COM versions of PopChart Embedder. This method is only implemented in COM for PopChart Embedder versions 4.0.1 and higher.
Syntax myPopChart.setDBQuery(graphname, driver, database, user, password, query);
Description Instructs the PopChart Embedder to make an SQL query to the specified database. The resulting data will be loaded into the specified graph, and will replace any existing data.
You can connect to any type of database, as long as that database has a JDBC driver (for Java), or has been set up as an ODBC data source on the computer running PopChart Server (for COM and C++).
Note: For JDBC data sources, be sure that the driver is included in the classpath or header for your application.
Example 4.12 illustrates how to call this method in Java. For more information about using databases with PopChart Embedder, refer to "Importing Data Directly from Databases" in Chapter 6 of the PopChart Server User Guide.
Parameters The setDBQuery() method accepts the following parameters.
The name of the graph object into which you want to import the data. Usually, this is graph, but check the appearance file to be sure.
In Java, this is the JDBC driver name. Make sure this driver has been included in the classpath for your web application.
For COM, this parameter is not used and should be set to an empty String.
In Java, this is the database URL (e.g. jdbc:obdc:bcdemo).
For COM, this is the DSN name of the ODBC database that you want to connect to. For DSN-less connections, you should instead set this to a string containing the information necessary to identify your database (e.g. "Provider=SQLOLEDB.1;Password=MyPassword;Persist Security Info=True;User ID=MyUserID;Initial Catalog=Northwind;Data Source=MyDataServer").
A valid user name for that database. If no user name is required, you should set this parameter to an empty String.
The user's password. If no password is required, you should set this parameter to an empty String.