JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

expand all

Profile: desktop, common

Overview

Datasource connecting to a database via JDBC.

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicconnectionStringString

Standard JDBC connection string (URL).

publicdriverParamsString

Additional driver parameters or null.

Additional driver parameters or null. This property is currently not used by this data source.

 
public-initlazyLoadingBoolean

Lazy loading is useful for large tables with lots of rows when fetching data at once would cause performance issues.

Lazy loading is useful for large tables with lots of rows when fetching data at once would cause performance issues. It is recommended to use the cursor functionality (next, previous, current) of RecordSet in conjunction with lazy loading.

 
publicpasswordString

Password for authentication purposes or null if authentication is not used or required.

publicqueryString

SQL query to use when fetching data.

SQL query to use when fetching data. The query should comply with SQL syntax of calling database.

 
publicuserString

Username for authentication purposes or null if authentication is not used or required.

Inherited Variables

org.netbeans.javafx.datasrc.DataSource

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicautoRefreshBoolean

Set autoRefresh to false if you want getRecordSet() calls to block, ie.

Set autoRefresh to false if you want getRecordSet() calls to block, ie. if you need data immediately. Set to true to let the DataSource automatically fetch data in the background on application startup and with every change to any datasource property.

 
public-read protectedfetchErrorExceptionsubclasssubclass

Contains an Exception after an unsuccessful data fetch, null otherwise.

public-read protectedfetchingDataBooleansubclasssubclass

An indicator set to true whenever the DataSource is in the process of fetching data.

Function Summary

public create(table: java.lang.String, fields: Byte[]) : Integer
Parameters
table
fields
Returns
Integer
 
public execute(sql: java.lang.String) : Void
Parameters
sql
 
public fetchData() : Void
 
public metaData() : RecordSetMetadata
Returns
RecordSetMetadata
 
public remove(table: java.lang.String, whereClause: java.lang.String) : Integer
Parameters
table
whereClause
Returns
Integer
 
public update(table: java.lang.String, fields: Byte[], whereClause: java.lang.String) : Integer
Parameters
table
fields
whereClause
Returns
Integer
 

Inherited Functions

org.netbeans.javafx.datasrc.DataSource

protected autorefresh() : Void

Derived class call this when their specific properties change.

Derived class call this when their specific properties change. This class insures that refresh() is called when autoRefresh property is set to true.

 
protected dataFetched(newData: RecordSet) : RecordSet

Callback function that data source classes call when they successfuly fetch data in response to fetchData() call.

Callback function that data source classes call when they successfuly fetch data in response to fetchData() call.

Parameters
newData
a RecordSet containing fetched data
Returns
RecordSet
 
protected dataFetchError(exception: java.lang.Exception) : RecordSet

Callback function that data source classes call when they fail to fetch data in response to fetchData() call.

Callback function that data source classes call when they fail to fetch data in response to fetchData() call.

Parameters
exception
an exception that defined the failure
Returns
RecordSet
 
protected abstract fetchData() : Void

A derived class overrides this to fetch data.

A derived class overrides this to fetch data. When it succeeds, it calls the dataFetched() callback function. When it fails, it calls the dataFetchError callback. Derived classes are free to fetch data asynchronously.

 
public bound getDataSource(expression: java.lang.String) : DataSource

Filters data from this datasource according to the given expression.

Filters data from this datasource according to the given expression.

Parameters
expression
filter expression. Currently, only a simple "field" expressions are supported. For example, from https://netbeans.org/api/projects.json you can get "projects", "href" and other first-level child data sources.
Returns
DataSource
a DataSource that holds a subset of data of this datasource, filtered by the given expression
 
public bound getRecordSet() : RecordSet

Retrieves data from this datasource.

Retrieves data from this datasource. The exact format of data depends on the concrete DataSource implementation.

Returns
RecordSet
a RecordSet object holding data or null if data is still fetching or if an error occured while fetching data
 
public abstract metaData() : RecordSetMetadata
Returns
RecordSetMetadata
metadata about produced data or null if data has not yet been fetched
 
public refresh() : Void

Forces this data source to re-fetch all data.

Forces this data source to re-fetch all data.