Klasse DataSourceConfiguration

java.lang.Object
com.inet.report.config.datasource.DataSourceConfiguration
Alle implementierten Schnittstellen:
Serializable, Comparable

public class DataSourceConfiguration extends Object implements Serializable, Comparable
A DataSourceConfiguration is a description of a data source, that can be used by an i-net Clear Reports report.
We differentiate between a data source that use a JDBC driver and a data source that use a com.inet.report.database.DataFactory extended class. In last case the report data will be set directly by Database class. In first case i-net Clear Reports use the settings of this data source configuration to establish a JDBC connection to a database server. Then it requests the data via SQL statements.
At execution time of the report, i-net Clear Reports creates the connection to the database, based on this settings.

If i-net Clear Reports runs inside of an application server, it will try to find a connection via JNDI.
The path to receive the DataSource from application server is : "java:comp/env/jdbc/"+DataSourceConfiguration.
If no data source was found, i-net Clear Reports creates the connection by itself.

Typical a DataSourceConfiguration will be created with the GUI but you can also create it via API.
Example for a DataSourceConfiguration based on a Database class:
DataSourceConfiguration dsc = DataSourceConfigurationManager.createDataSourceConfiguration( "myFirstDSC", DataSourceConfigurationManager.TEMPORARY_PREFERENCES );
dsc.setDatabaseClassname( "com.company.DatabaseImpl" );
dsc.setDriverLibrary( "c:/lib/reportclasses.jar" );//you can also set an URL
dsc.save( DataSourceConfigurationManager.TEMPORARY_PREFERENCES ); //-> manager -> store
Samples for own Database classes can be found in sample library at:
samples.jdbc.DatabaseClassUsableInDesigner
samples.jdbc.DataWithExternalResultSet
samples.jdbc.DataWithoutJDBC

Example for a DataSourceConfiguration based on a JDBC driver / database connection:

DataSourceConfiguration dsc = DataSourceConfigurationManager.createDataSourceConfiguration( "myFirstDSC", DataSourceConfigurationManager.TEMPORARY_PREFERENCES );
dsc.addProperty( DataSourceConfiguration.PROPERTY_DRIVER_CLASSNAME, "com.inet.tds.TdsDriver" );//MS SQL Server driver from i-net software
dsc.addProperty( DataSourceConfiguration.PROPERTY_URL, "jdbc:inetdae7" );
dsc.addProperty( DataSourceConfiguration.PROPERTY_USER, "sa" );
dsc.addProperty( DataSourceConfiguration.PROPERTY_PASSWORD, "xxxx" );
dsc.addProperty( "host", "localhost");        //a driver specific property
dsc.addProperty( "database", "northwind" );   //a driver specific property
dsc.save( DataSourceConfigurationManager.TEMPORARY_PREFERENCES ); //-> manager -> store

...

create a new report based on this datasource configuration

Engine e = RDC.createEmptyEngine();
Datasource ds = e.getDatabaseTables().createDatasource("myFirstDSC");
TableSource ts = ds.create...

switch an existing Datasource to a DataSourceConfiguration

Engine eng = new Engine( Engine.NO_EXPORT );
eng.setReportFile("c:/sample.rpt");
Datasource ds = eng.getDatabaseTables().getDatasource(0);
ds.setDataSourceConfigurationName("myFirstDSC");


Siehe auch:
  • Feldübersicht

    Felder
    Modifikator und Typ
    Feld
    Beschreibung
    static final String
    The property that stores the "aliasToken" flag.
    static final String
    The property defines a comma separated list of GUID that are allowed to use this datasource.
    static final String
    The property that stores the catalog.
    static final String
    The property that stores the com.inet.report.database.DataFactory
    static final String
    The property that stores the full qualified class name of JDBC Driver.
    static final String
    The property that stores the "escapeEverything" flag.
    static final String
    The property that stores the "identifierQuoteString" flag.
    static final String
    The property defining the SQL statement which should be executed after the JDBC connection has been established.
    static final String
    The property that stores the user password.
    static final String
    The property that stores the "quotesLowerCase" flag.
    static final String
    The property that stores the "savePassword" flag.
    static final String
    The property that stores the "supportsOrderBy" flag.
    static final String
    The property that stores the "supportsSQL92" flag.
    static final String
    The property that stores the "supportsWhere" flag.
    static final String
    The property that stores the JDBC URL.
    static final String
    The property that stores the "supportsParenthesesForJoin" flag.
    static final String
    The property that stores the user.
    static final String
    The property that stored the validation query.
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    DataSourceConfiguration(String configurationName, int scope)
    Create a new data source configuration
  • Methodenübersicht

    Modifikator und Typ
    Methode
    Beschreibung
    static String
    adaptUrl(String url, Properties driverProps)
    Adapts the provided URL by replacing placeholders of format {propertyname} with the value of the regarding property in the provided Properties object.
    void
    Adds all properties by forward to function DataSourceConfiguration.addProperty(String, String).
    void
    addProperty(String key, String value)
    Add property to configure the used JDBC driver.
    int
    Order this class by name.
    boolean
    Returns the SQL keyword that is required to define an alias name in a SQL statement.
    For some databases a whitespace have to be set between table name and table alias.
    Set<com.inet.id.GUID>
    Returns the list of group-GUIDs that are allowed to access this datasource
    Returns the set database catalog.
    Get the list of catalogs.
    Returns the name of this DataSourceConfiguration.
    Returns com.inet.report.database.DataFactory class name or an empty String.
    @Nonnull com.inet.report.DatabaseConfiguration
    FOR INTERNAL USE ONLY Returns the DatabaseConfiguration used for this DataSourceConfiguration.
    Returns the name of the java.sql.Driver that will be used to establish the Connection to database.
    static Driver
    FOR INTERNAL USE ONLY iterate over registered driver - necessary for silly JdbcOdbcDriver, which set a flag in its finalize() function so that no Connection could create anymore.
    static Driver
    FOR INTERNAL USE ONLY iterate over registered driver - necessary for silly JdbcOdbcDriver, which set a flag in its finalize() function so that no Connection could create anymore
    FOR INTERNAL USE ONLY returns all properties that will be passed to JDBC driver
    Returns the string used to quote SQL identifiers.
    Returns the password of the database user used to create database connection.
    Returns all properties stored in this DataSourceConfiguration.
    @Nonnull String
    Returns the value of the passed property key.
    int
    Get the scope in which the datas ource was created.
    com.inet.id.GUID
    Get the unique ID of the data source.
    Returns the set JDBC URL that will be used to create the Connection.
    Returns the set database user.
    Returns the set SQL validation query which should be used to check if the database connection is valid or not.
    int
    boolean
    Returns if this datasource is a source for creating ad hoc reporting layouts.
    boolean
    Returns false if the current driver does not need a password.
    boolean
    Returns if the password should be saved.
    boolean
    Returns the value of the flag escapeEverything.
    boolean
    Indicates whether an ORDER BY clause is allowed for the SQL statement.
    If false is set, i-net Clear Reports creates a SQL statement without ORDER BY clause.
    boolean
    Indicates whether parentheses are allowed in FROM clause of the SQL statement.
    For example the SAPDB does not support parentheses in JOIN syntax.
    This flag is relevant if tables and one Datasource is used only.
    boolean
    Indicates whether table names and column names have to be quoted.
    This property can be necessary for Oracle/PostgreSQL databases for example, if table/column where created with quotes and lower (Oracle) or upper (PostgreSQL) case characters.
    boolean
    Indicates whether the SQL statement can contain the join condition in SQL92 syntax or not.
    boolean
    Indicates whether the SQL statement can contain the WHERE clause or not.
    If false is set, i-net Clear Reports creates a SQL statement without WHERE clause.
    void
    putStylesheetDefaultValues(@Nonnull com.inet.report.config.datasource.widget.DriverStyleSheet dss)
    FOR INTERNAL USE ONLY Applies the properties of the supplied DriverStyleSheet to this DataSourceConfiguration and remove not supported driver properties.
    void
    removes all properties from the driver properties whose keys are in the string set
    void
    Save the settings persistent.
    void
    save(int scope)
    Veraltet.
    As of i-net Clear Reports 19.2, use save()
    void
    setAliasToken(String aliasToken)
    Sets the SQL keyword that will be put between table name and table alias.
    E.g. the database PostgreSql requires the keyword "AS".
    void
    setAllowedUserGroups(Set<com.inet.id.GUID> allowedUserGroups)
    Sets the list of group-GUIDs that will grant access to this datasource
    void
    setCatalog(String catalog)
    Sets the database catalog used to create database connection.
    void
    Sets the class name of a class extended from com.inet.report.database.DataFactory.
    void
    Sets the class name of a java.sql.Driver implementation.
    void
    setIdentifierQuoteString(String identifierQuoteString)
    Sets the string used to quote SQL identifiers.
    void
    setPassword(String password)
    Sets the password of the database user used to create database Connection.
    void
    setSavePassword(boolean savePassword)
    Sets whether the password should be saved or not.
    void
    Sets JDBC url that will be used to create the Connection.
    void
    setUseEscapeEverything(boolean escapeEverything)
    This method is for adapt the SQL statement for a specific database.
    This flag influence the way SQL identifier are written to SQL statement.
    void
    setUseOrderBy(boolean useOrderBy)
    Set here whether the SQL statement can have an ORDER BY clause or not.
    If false is set, i-net Clear Reports creates a SQL statement without ORDER BY clause.
    void
    setUseParenthesiseForJoin(boolean useParenthesiseForJoin)
    Set here whether the SQL statement can have parentheses in FROM clause or not.
    For example the SAPDB does not support parentheses in JOIN syntax.
    This flag is relevant if tables and one Datasource is used only.
    void
    setUseQuoteLowerCase(boolean useQuoteLowerCase)
    Set here whether table names and column names have to be quoted.
    This property can be necessary for Oracle/PostgreSQL databases for example, if table/column where created with quotes and lower (Oracle) or upper (PostgreSQL) case characters.
    void
    Sets the database user used to create database connection.
    void
    setUseSQL92syntax(boolean useSQL92syntax)
    Set here whether the SQL statement can contain the join condition in SQL92 syntax or not.
    If set on true, the join is contained in FROM clause, otherwise in WHERE clause.
    Note: full outer join is not possible in WHERE clause.
    void
    setUseWhereClause(boolean useWhereClause)
    Indicates whether the SQL statement can contain the WHERE clause or not.
    If false is set, i-net Clear Reports creates a SQL statement without ORDER BY clause.
    void
    setValidationQuery(String validationQuery)
    Sets the SQL query which should be executed to validate the connection defined by this DataSourceConfiguration.
    Returns the name of this DataSourceConfiguration.
    Checks if it is possible to get a connection based on this DataSourceConfiguration. Throw an exception if the connection can't be established.

    Von Klasse geerbte Methoden Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Felddetails

  • Konstruktordetails

    • DataSourceConfiguration

      public DataSourceConfiguration(String configurationName, int scope)
      Create a new data source configuration
      Parameter:
      configurationName - the name of this DataSourceConfiguration.
      scope - the scope, once of the DataSourceConfigurationManager constants
      Löst aus:
      IllegalArgumentException - in case of misusing the the scope
      Seit:
      19.2
  • Methodendetails

    • getScope

      public int getScope()
      Get the scope in which the datas ource was created.
      Gibt zurück:
      the scope.
      Seit:
      19.2
    • getUID

      public com.inet.id.GUID getUID()
      Get the unique ID of the data source.
      Gibt zurück:
      the id
      Seit:
      19.2
    • getDatabaseConfiguration

      public @Nonnull com.inet.report.DatabaseConfiguration getDatabaseConfiguration()
      FOR INTERNAL USE ONLY Returns the DatabaseConfiguration used for this DataSourceConfiguration. This method is needed to tell the Database class which DatabaseConfiguration should be used if the Datasource uses a DataSourceConfiguration. Note: We have to return a cloned instance because the instance might be modified at runtime and we don't want these changes to be set for the whole DataSourceConfiguration because the reason will be report-specific.
      Example: If the record selection could not be executed on database the flag useWhereClause will be set to false. This change should only be made for the particular report.
      Gibt zurück:
      The DatabaseConfiguration to be used with this DataSourceConfiguration.
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object
    • putStylesheetDefaultValues

      public void putStylesheetDefaultValues(@Nonnull com.inet.report.config.datasource.widget.DriverStyleSheet dss)
      FOR INTERNAL USE ONLY Applies the properties of the supplied DriverStyleSheet to this DataSourceConfiguration and remove not supported driver properties.
      Parameter:
      dss - The DriverStyleSheet from where the properties should be copied.
    • addProperty

      public void addProperty(String key, String value)
      Add property to configure the used JDBC driver. Please read the driver manual of the vendor to find out which properties are supported by the used JDBC driver.
      Parameter:
      key - the property.
      value - the property value.
      Löst aus:
      NullPointerException - If the property key was null.
      IllegalArgumentException - If the property key was empty.
      Seit:
      7.0
      Siehe auch:
    • addProperties

      public void addProperties(Properties properties)
      Adds all properties by forward to function DataSourceConfiguration.addProperty(String, String).
      Parameter:
      properties - A Properties object containing all properties which should be set for this DataSourceConfiguration.
      Seit:
      7.0
      Siehe auch:
    • removeProperties

      public void removeProperties(Set<String> keys)
      removes all properties from the driver properties whose keys are in the string set
      Parameter:
      keys - set of keys whose entries are to be removed from the driver properties
      Seit:
      19.2
    • isUseOrderBy

      public boolean isUseOrderBy()
      Indicates whether an ORDER BY clause is allowed for the SQL statement.
      If false is set, i-net Clear Reports creates a SQL statement without ORDER BY clause. Sorting will be done by i-net Clear Reports itself. This flag is relevant if tables and one Datasource is used only.
      Gibt zurück:
      true if the SQL statement can have an ORDER BY clause; otherwise false.
      Seit:
      6.0
      Siehe auch:
    • setUseOrderBy

      public void setUseOrderBy(boolean useOrderBy)
      Set here whether the SQL statement can have an ORDER BY clause or not.
      If false is set, i-net Clear Reports creates a SQL statement without ORDER BY clause. Sorting will be done by i-net Clear Reports itself. This flag is relevant if tables and one Datasource is used only.
      Parameter:
      useOrderBy - Whether the SQL statement can have an ORDER BY clause or not.
      Seit:
      6.0
      Siehe auch:
    • isUseParenthesiseForJoin

      public boolean isUseParenthesiseForJoin()
      Indicates whether parentheses are allowed in FROM clause of the SQL statement.
      For example the SAPDB does not support parentheses in JOIN syntax.
      This flag is relevant if tables and one Datasource is used only.
      Gibt zurück:
      true if the SQL statement can have parentheses in FROM clause; otherwise false.
      Seit:
      6.0
      Siehe auch:
    • setUseParenthesiseForJoin

      public void setUseParenthesiseForJoin(boolean useParenthesiseForJoin)
      Set here whether the SQL statement can have parentheses in FROM clause or not.
      For example the SAPDB does not support parentheses in JOIN syntax.
      This flag is relevant if tables and one Datasource is used only.
      Parameter:
      useParenthesiseForJoin - Whether the SQL statement can have parentheses in FROM clause or not.
      Seit:
      6.0
      Siehe auch:
    • isUseQuoteLowerCase

      public boolean isUseQuoteLowerCase()
      Indicates whether table names and column names have to be quoted.
      This property can be necessary for Oracle/PostgreSQL databases for example, if table/column where created with quotes and lower (Oracle) or upper (PostgreSQL) case characters.
      Gibt zurück:
      true if table names and column names have to be quoted; otherwise false.
      Seit:
      6.0
      Siehe auch:
    • setUseQuoteLowerCase

      public void setUseQuoteLowerCase(boolean useQuoteLowerCase)
      Set here whether table names and column names have to be quoted.
      This property can be necessary for Oracle/PostgreSQL databases for example, if table/column where created with quotes and lower (Oracle) or upper (PostgreSQL) case characters.
      Parameter:
      useQuoteLowerCase - Whether table names and column names have to be quoted.
      Seit:
      6.0
      Siehe auch:
    • isUseSQL92syntax

      public boolean isUseSQL92syntax()
      Indicates whether the SQL statement can contain the join condition in SQL92 syntax or not.
      Gibt zurück:
      true if the SQL statement can contain the join condition in SQL92 syntax; otherwise false.
      Seit:
      6.0
      Siehe auch:
    • setUseSQL92syntax

      public void setUseSQL92syntax(boolean useSQL92syntax)
      Set here whether the SQL statement can contain the join condition in SQL92 syntax or not.
      If set on true, the join is contained in FROM clause, otherwise in WHERE clause.
      Note: full outer join is not possible in WHERE clause.
      Parameter:
      useSQL92syntax - Whether the SQL statement can contain the join condition in SQL92 syntax or not.
      Seit:
      6.0
      Siehe auch:
    • isUseWhereClause

      public boolean isUseWhereClause()
      Indicates whether the SQL statement can contain the WHERE clause or not.
      If false is set, i-net Clear Reports creates a SQL statement without WHERE clause. Filter data will be done by i-net Clear Reports itself. This flag is relevant if tables and one Datasource is used only.
      Gibt zurück:
      true if the SQL statement can contain the WHERE clause; otherwise false.
      Seit:
      6.0
      Siehe auch:
    • setUseWhereClause

      public void setUseWhereClause(boolean useWhereClause)
      Indicates whether the SQL statement can contain the WHERE clause or not.
      If false is set, i-net Clear Reports creates a SQL statement without ORDER BY clause. Filter data will be done by i-net Clear Reports itself. This flag is relevant if tables and one Datasource is used only.
      Parameter:
      useWhereClause - Whether the SQL statement can contain the WHERE clause or not.
      Seit:
      6.0
      Siehe auch:
    • getAliasToken

      public String getAliasToken()
      Returns the SQL keyword that is required to define an alias name in a SQL statement.
      For some databases a whitespace have to be set between table name and table alias. Other database expect the keyword "AS".
      Gibt zurück:
      String the SQL keyword
      Seit:
      6.0
      Siehe auch:
    • setAliasToken

      public void setAliasToken(String aliasToken)
      Sets the SQL keyword that will be put between table name and table alias.
      E.g. the database PostgreSql requires the keyword "AS".
      Parameter:
      aliasToken - the SQL keyword.
      Seit:
      6.0
      Siehe auch:
    • isUseEscapeEverything

      public boolean isUseEscapeEverything()
      Returns the value of the flag escapeEverything.
      Gibt zurück:
      true if the complete table identifier will enclosed with quotes; otherwise false.
      Seit:
      6.0
      Siehe auch:
    • setUseEscapeEverything

      public void setUseEscapeEverything(boolean escapeEverything)
      This method is for adapt the SQL statement for a specific database.
      This flag influence the way SQL identifier are written to SQL statement. Per default it is false and should be kept false for most of database.
      If the flag is set to true, the complete table identifier will enclosed with quotes.
      If the table identifier contains catalog/schema information, the complete expression will enclosed with quotes.
      Example - escape everything is true:
      the original table identifier is "atable" in catalog "aCatalog".
      The resulting expression for the table in the SQL statement will be : select ... from "aCatalog.aTable"
      note: this syntax is not allowed for most of databases. The only known case setting this flag to true is using i-net FOSITEX driver for CSV data files.
      Parameter:
      escapeEverything - True if the whole table identifier should be quoted false(default) otherwise.
      Seit:
      6.0
      Siehe auch:
    • getIdentifierQuoteString

      public String getIdentifierQuoteString()
      Returns the string used to quote SQL identifiers.
      Gibt zurück:
      String used to quote SQL identifiers.
      Seit:
      6.0
      Siehe auch:
    • setIdentifierQuoteString

      public void setIdentifierQuoteString(String identifierQuoteString)
      Sets the string used to quote SQL identifiers.
      Parameter:
      identifierQuoteString - The string which should be used to quote SQL identifiers. Usually this should be a single or double quote.
      Seit:
      6.0
      Siehe auch:
    • getDriverClassname

      public String getDriverClassname()
      Returns the name of the java.sql.Driver that will be used to establish the Connection to database.
      Gibt zurück:
      String the driver class name
      Seit:
      6.0
    • getDatabaseClassname

      public String getDatabaseClassname()
      Returns com.inet.report.database.DataFactory class name or an empty String.
      Gibt zurück:
      String DataFactory class name or an empty String.
      Seit:
      6.0
    • setDriverClassname

      public void setDriverClassname(String classname)
      Sets the class name of a java.sql.Driver implementation.
      Parameter:
      classname - The package qualified name of the JDBC Driver class.
      Seit:
      6.0
    • setDatabaseClassname

      public void setDatabaseClassname(String classname)
      Sets the class name of a class extended from com.inet.report.database.DataFactory. Instead of using a JDBC Connection to fetch data for the report, a com.inet.report.database.DataFactory can be used to set the data via java code directly.

      For class loading from other plugins this class can registered in the plugin manager via: spm.register( DataFactory.class, instance )

      Parameter:
      classname - the full qualified classname of a com.inet.report.database.DataFactory class.
      Seit:
      6.0
    • getConfigurationName

      public String getConfigurationName()
      Returns the name of this DataSourceConfiguration.
      Gibt zurück:
      String - the name of this DataSourceConfiguration.
      Seit:
      6.0
    • toString

      public String toString()
      Returns the name of this DataSourceConfiguration.
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      String - the name of this DataSourceConfiguration.
      Seit:
      6.0
      Siehe auch:
    • getUrl

      public String getUrl()
      Returns the set JDBC URL that will be used to create the Connection.
      Gibt zurück:
      the set JDBC URL that will be used to create the Connection.
      Seit:
      6.0
    • setUrl

      public void setUrl(String url)
      Sets JDBC url that will be used to create the Connection.
      Parameter:
      url - the JDBC url that will be used to create the Connection.
      Seit:
      6.0
    • getProperties

      public Properties getProperties()
      Returns all properties stored in this DataSourceConfiguration. It contains at least the listed properties below. The configuration name is not listed in the Properties object.
      Gibt zurück:
      all properties stored in this DataSourceConfiguration.
      Seit:
      6.0
    • getDriverSpecificProperties

      public String[] getDriverSpecificProperties()
      FOR INTERNAL USE ONLY returns all properties that will be passed to JDBC driver
      Gibt zurück:
      all properties that will be passed to JDBC driver
      Seit:
      6.0
    • getProperty

      public @Nonnull String getProperty(String key)
      Returns the value of the passed property key.
      Parameter:
      key - the key of the set property.
      Gibt zurück:
      String - The property value or an empty string.
      Seit:
      6.0
    • getCatalog

      public String getCatalog()
      Returns the set database catalog.
      Gibt zurück:
      String - the database catalog or an empty String.
      Seit:
      7.0
    • setCatalog

      public void setCatalog(String catalog)
      Sets the database catalog used to create database connection.
      Parameter:
      catalog - - the database catalog used to create database connection.
      Seit:
      7.0
    • getUser

      public String getUser()
      Returns the set database user.
      Gibt zurück:
      String - the database user or an empty String.
      Seit:
      6.0
    • setUser

      public void setUser(String user)
      Sets the database user used to create database connection.
      Parameter:
      user - - the database user used to create database connection.
      Seit:
      6.0
    • getPassword

      public String getPassword()
      Returns the password of the database user used to create database connection.
      Gibt zurück:
      String - the password of the database user used to create database connection or an empty string.
      Seit:
      6.0
    • setPassword

      public void setPassword(String password)
      Sets the password of the database user used to create database Connection.
      Parameter:
      password - the password of the database user used to create database Connection.
      Seit:
      6.0
    • setSavePassword

      public void setSavePassword(boolean savePassword)
      Sets whether the password should be saved or not.
      Parameter:
      savePassword - true for saving password
      Seit:
      6.0
      Siehe auch:
    • isSavePassword

      public boolean isSavePassword()
      Returns if the password should be saved.
      Gibt zurück:
      true if the password should be saved
      Seit:
      6.0
      Siehe auch:
    • isNeedPassword

      public boolean isNeedPassword()
      Returns false if the current driver does not need a password. If it need a password or we does not know it then it return true.
      Gibt zurück:
      false if no password is needed.
      Seit:
      9.2
    • save

      @Deprecated public void save(int scope) throws SecurityException
      Veraltet.
      As of i-net Clear Reports 19.2, use save()
      Saves the settings of this DataSourceConfiguration to the underlying store (XML file). Only if this function was called, changes affects the report execution.
      Parameter:
      scope - - Possible values:
      • DataSourceConfigurationManager.SYSTEM_PREFERENCES
      • DataSourceConfigurationManager.USER_PREFERENCES
      Löst aus:
      SecurityException - if there is no write access to the given Java Preferences
      Seit:
      6.0
    • save

      public void save()
      Save the settings persistent. The location depends on the scope and the OS.
      Seit:
      19.2
    • getDriverObject

      public static Driver getDriverObject(Class<?> c)
      FOR INTERNAL USE ONLY iterate over registered driver - necessary for silly JdbcOdbcDriver, which set a flag in its finalize() function so that no Connection could create anymore.
      Parameter:
      c - the driver class
      Gibt zurück:
      the Driver object for the given class
      OR null
      Seit:
      6.0
    • getDriverObject

      public static Driver getDriverObject(String c)
      FOR INTERNAL USE ONLY iterate over registered driver - necessary for silly JdbcOdbcDriver, which set a flag in its finalize() function so that no Connection could create anymore
      Parameter:
      c - the name of the driver class
      Gibt zurück:
      the Driver object for the given class name
      OR null if the class can't be found
      Seit:
      6.0
    • validate

      Checks if it is possible to get a connection based on this DataSourceConfiguration. Throw an exception if the connection can't be established. The exception include details of the problem.
      Gibt zurück:
      SQL warning if there is one generated.
      Löst aus:
      ClassNotFoundException - If the class could not be found in the current class path nor the lib directory of i-net Clear Reports.
      InstantiationException - if the driver class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason.
      IllegalAccessException - if the driver class or its nullary constructor is not accessible.
      SQLException - if a database access error occurs
      ReportException - If the JDBC URL is not valid for the given driver.
      ClassCastException - If the database class name is not an instance of com.inet.report.database.DataFactory
      Seit:
      10.0
    • getCatalogs

      Get the list of catalogs.
      Gibt zurück:
      the list or null if there is no drver class
      Löst aus:
      ClassNotFoundException - If the class could not be found in the current class path nor the lib directory of i-net Clear Reports.
      InstantiationException - if the driver class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason.
      IllegalAccessException - if the driver class or its nullary constructor is not accessible.
      SQLException - if a database access error occurs
      ReportException - If the JDBC URL is not valid for the given driver.
      Seit:
      15.0
    • adaptUrl

      public static String adaptUrl(String url, Properties driverProps)
      Adapts the provided URL by replacing placeholders of format {propertyname} with the value of the regarding property in the provided Properties object.
      Parameter:
      url - The URL to adapt.
      driverProps - The driver properties to be inserted into the URL.
      Gibt zurück:
      The modified URL.
      Seit:
      8.0
    • setValidationQuery

      public void setValidationQuery(String validationQuery)
      Sets the SQL query which should be executed to validate the connection defined by this DataSourceConfiguration. Usually Connection.isClosed() will be called to check if the connection is still valid. In some circumstances it is possible that this returns true although the connection is invalid. (e.g. the network connection to the database is still established but the database server does not accept any further query). In this case the connection can be checked with a simple SQL query. If this query can be executed without any error the connection should be valid.
      Parameter:
      validationQuery - The SQL query which should be executed for validation of the database connection.
      Seit:
      7.0
      Siehe auch:
    • getValidationQuery

      public String getValidationQuery()
      Returns the set SQL validation query which should be used to check if the database connection is valid or not.
      Gibt zurück:
      The SQL query used for validation of the database connection.
      Seit:
      7.0
      Siehe auch:
    • compareTo

      public int compareTo(Object o)
      Order this class by name. It uses String.compareTo(String).
      Note: this class has a natural ordering that is inconsistent with equals.
      Angegeben von:
      compareTo in Schnittstelle Comparable
      Parameter:
      o - DatasourceConfiguration to be compared with
      Gibt zurück:
      the value 0 if the passed configuration's name is a string lexicographically equal to this configuration's name; a value less than 0 if the passed configuration's name is a string lexicographically greater than this configuration's name; and a value greater than 0 if the passed configuration's name is a string lexicographically less than this configuration's name.
      Seit:
      6.0
      Siehe auch:
    • isLayoutDataSource

      public boolean isLayoutDataSource()
      Returns if this datasource is a source for creating ad hoc reporting layouts.
      Gibt zurück:
      true if it is a datasource for creating ad hoc reporting layouts, false otherwise.
      Seit:
      10.0
    • getAllowedUserGroups

      public Set<com.inet.id.GUID> getAllowedUserGroups()
      Returns the list of group-GUIDs that are allowed to access this datasource
      Gibt zurück:
      the list of group GUIDs that are allowed to use this datasource
      Seit:
      19.2
    • setAllowedUserGroups

      public void setAllowedUserGroups(Set<com.inet.id.GUID> allowedUserGroups)
      Sets the list of group-GUIDs that will grant access to this datasource
      Parameter:
      allowedUserGroups - the list of group-GUIDs that are allowed to use this datasource
      Seit:
      19.2