Servoy 5.x Public API

com.servoy.j2db.util
Class DataSourceUtils

java.lang.Object
  extended by com.servoy.j2db.util.DataSourceUtils

public class DataSourceUtils
extends Object



Normal Use: static methods


Field Summary
static String DB_DATASOURCE_SCHEME
           
static String DB_DATASOURCE_SCHEME_COLON_SLASH
           
static int DB_DATASOURCE_SCHEME_COLON_SLASH_LENGTH
           
static String INMEM_DATASOURCE_SCHEME
           
 
Method Summary
static String createDBTableDataSource(String serverName, String tableName)
          Create the a database data source string from server and table
static String createInmemDataSource(String name)
          Create the a data source string for an inmemory table
static String[] getDBServernameTablename(String dataSource)
          Get the server and table name from the datasource (when is is a db datasource)
static SortedSet<String> getServerNames(Set<String> dataSources)
          Get the sorted set of server names used server names in the data sources list
static List<String> getServerTablenames(Set<String> dataSources, String serverName)
          Get the table names with the given server name in the data sources list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB_DATASOURCE_SCHEME

public static final String DB_DATASOURCE_SCHEME
See Also:
Constant Field Values

DB_DATASOURCE_SCHEME_COLON_SLASH

public static final String DB_DATASOURCE_SCHEME_COLON_SLASH
See Also:
Constant Field Values

DB_DATASOURCE_SCHEME_COLON_SLASH_LENGTH

public static final int DB_DATASOURCE_SCHEME_COLON_SLASH_LENGTH

INMEM_DATASOURCE_SCHEME

public static final String INMEM_DATASOURCE_SCHEME
See Also:
Constant Field Values
Method Detail

createDBTableDataSource

public static String createDBTableDataSource(String serverName,
                                             String tableName)
Create the a database data source string from server and table

Parameters:
serverName - the serverName
tableName - the tableName
Returns:
the table name

createInmemDataSource

public static String createInmemDataSource(String name)
Create the a data source string for an inmemory table

Parameters:
name -
Returns:

getDBServernameTablename

public static String[] getDBServernameTablename(String dataSource)
Get the server and table name from the datasource (when is is a db datasource)

Parameters:
dataSource - the dataSource
Returns:
the server and table name (or null if not a db datasource)

getServerNames

public static SortedSet<String> getServerNames(Set<String> dataSources)
Get the sorted set of server names used server names in the data sources list

Parameters:
server - names
Returns:

getServerTablenames

public static List<String> getServerTablenames(Set<String> dataSources,
                                               String serverName)
Get the table names with the given server name in the data sources list

Parameters:
table - names
Returns:

Copyright © 2010 Servoy B.V.