input
stringlengths
10
828
output
stringlengths
5
107
private array list create empty row string table name array list row new array list number of columns row add table name for int j 1 j number of columns j row add return row
create an empty row with the specified table name as the first value
public boolean supports ext odbcsql return supports ext odbcsql
does this database support extended odbc sql grammer
private void clear username jtext field set text password jtext field set text jdbc urljtext field set text jdbc driver jlabel set text database product name jlabel set text database product version jlabel set text other properties jtext field set text
clear all fields
public list get supported types extract the types as strings from the array list of sql types objects list types new array list for int i 0 i sql types supported size i types add sql type sql types supported get i get type return types
gets the sql types supported by this database
private void close dialog this hide this dispose
close and dispose of the dialog
public boolean supports exp in order by return supports exp in order by
does this database support expressions in the order by statement
public boolean supports unrel order by return supports unrel order by
does this database support unrelated order by clauses columns in the
public int max columns in order by return max columns in order by
what is the maximum number of columns allowed in the order by clause
public boolean supports group by return supports group by
does this database support the group by clause
private void set boolean string table name int col boolean bool array list row null for int i 0 i table data size i row array list table data get i if row get 0 to string equals table name row set col bool boolean true boolean false fire table rows updated i i break
set the value of the specified column to boolean
public boolean supports unrelated group by return supports unrelated group by
does this database support unrelated group by clauses columns in the
public throwable get table transfer exception string table name if table name null return null return throwable table transfer exceptions get table name
get a throwable that has caused a table transfer to fail
public throwable get primary key transfer exception string table name if table name null return null return throwable primary key transfer exceptions get table name
get a throwable that has caused a primary key transfer to fail
public throwable get data transfer exception string table name if table name null return null return throwable data transfer exceptions get table name
get a throwable that has caused a tables data transfer to fail
public int get max columns in group by return max columns in group by
what is the maximum number of columns allowed in the group by clause
public list get table names return table names null table names new array list 0
gets a code list code of table names for this database
public iterator get table types return table types null table types iterator new array list 0 iterator
gets a code list code of table types for this database
public list get schemas return schema names null schema names new array list 0
gets a code list code of schema names for this database
private void populate tables database db meta data string schema jcombo box table types jcombo box jlist tables jlist if db meta data null tables jlist null return string type null if table types jcombo box get selected item null type table types jcombo box get selected item to string list tables db meta data get table names schema type default list model model new default list model for iterator i tables iterator i has next empty model add element i next tables jlist set model model
helper method to populate tables
public list get catalogs return catalog names null catalog names new array list 0
gets a code list code of catalog names for this database
private void define tab traversal source table types combo set next focusable component source tables jlist source tables jlist set next focusable component source columns jlist source columns jlist set next focusable component add table jbutton add table jbutton set next focusable component remove table jbutton remove table jbutton set next focusable component transfer tables jlist transfer tables jlist set next focusable component transfer columns jlist transfer columns jlist set next focusable component source table types combo
define the widget tab traversal order
public int get number tables return tables size
gets the number of tables
private boolean get metadata boolean result false try source metadata database cache get user connection manager get source connection jcombo box get selected item to string target metadata database cache get user connection manager get target connection jcombo box get selected item to string result true catch sqlexception e new error box db2 dbapplication instance get main jframe db2 dbapplication instance get rbstring database metadata error e return result
get the metadata for the selected source and target database
private boolean ok to transfer string schema string table return target metadata get table schema table null transfer manager get table table null transfer manager table transferred this session table
helper method to determine whether its o
private void maybe enable previous buttons if number of querys executed 1 previous sqlstatement action set enabled true first sqlstatement action set enabled true
increment the number of querys executed variable if it is bigger than one
public void do not transfer selected tables object tables transfer tables jlist get selected values int length tables length string table null for int i 0 i tables length i table tables i to string try transfer manager remove table table catch invalid transfer criteria exception e should never happen app get log error this get class e
the user has chosen not to transfer one or more tables
public table get table string schema string table db2 dbapplication instance get log debug this get class getting a table from schema schema called table table result null if schema null table equals for iterator i tables iterator i has next empty table t table i next if t get name equals table result new table t break else if schemas key set contains schema result schema schemas get schema get table table return result
gets a code table code object as specified by a name and schema
private void populate schemas combo box schemas combobox remove all items schemas combobox set model new default combo box model meta data get schemas to array
populate the schema combobox with the schemas
private void populate table types combo box table types combo remove all items table types combo set model new default combo box model meta data get table types retrieved
populate the table types combobox with the table types
public void perform current phase if current phased process null finish previous phase if any current phased process finish current phased process phased process phase map get new integer current phase current phased process start start the current phase display the required jpanel the current phase content pane remove all content pane add jpanel current phased process content pane revalidate content pane repaint set title
perform the current phase i
public boolean next phased process handler msg next null return current phase step four
convenience method called by a click of the next button
public boolean previous phased process handler msg prev null return is first
convenience method called by a click of the previous button
public void allow next boolean allow transfer jinternal frame allow next allow
this method can be overridden by implementations of this class to allow dissallow
public void allow previous boolean allow transfer jinternal frame allow previous allow
this method can be overridden by implementations of this class to allow dissallow
private void populate tables jlist clear the tables list list model lm tables jlist get model if lm instanceof default list model default list model lm remove all elements get the table names for the currently selected schema and table type string schema null if meta data supports schemas schema string value of schemas combobox get selected item tables jlist set list data meta data get table names schema string value of table types combo get selected item to array tables jlist revalidate
populate the table list with the tables
public schema get schema string schema schema result null if schemas contains key schema result new schema impl schema schemas get schema db2 dbapplication instance get log debug this get class database get schema returning schema result get name result get tables size if result null schema not been cached yet hand out a proxy schema proxy which will call cache schema when needed result new schema proxy schema this db2 dbapplication instance get log debug this get class database get schema returning schema proxy result get name return result
get a code schema code with the speicifed name possibly a proxy if
private void enable or disable transfer transfer action set enabled transfer manager tables has next
enable a transfer i
public void internal frame closed internal frame event e db2 dbapplication instance get log debug database browser jinternal frame class closing cleaning up resources clean up any resources for iterator i user connection manager iterator i has next string user connection name user connection i next get name if meta data map get user connection name null database meta data map get user connection name close
invoked when an internal frame has been closed
private void populate columns jlist string schema null string table null if meta data supports schemas object obj schemas combobox get selected item if obj null schema obj to string object obj tables jlist get selected value if obj null table obj to string add a to allow select from table querys list columns meta data get table schema table get column names columns add 0 set the data columns jlist set list data columns to array else columns jlist set list data new object 0 columns jlist revalidate
populate the column list with column names
public string get selected user connection return selected user connection
return the name of the user connection that the user selected
private void show empty mapping jlist set list data collections empty list to array
display an empty list
public sql type get sql type string type for int i 0 i sql types supported size i if sql type sql types supported get i get type equals type return sql type sql types supported get i return null
gets an code sql type code object as specified by its name
private void stop stopped true stop jbutton set enabled false text jlabel set text stopping action event action event new action event this stop id stop command 1 for iterator i listeners iterator i has next action listener i next action performed action event
indicate that the user has requested that the task be stopped
private void stop stopped true stop jbutton set enabled false task label set text stopping
indicate that the user has requested that the task be stopped
private void set title if current file null this set title query builder user connection get name current file else this set title query builder user connection get name
helper to set the frame title
public void set text string text task label set text text
set the text that is displayed on the progress dialog
public boolean supports catalogs return supports catalogs
does this database support catalogs
public void add item string label text jcomponent item char mnemonic create the label and its constraints jlabel label new jlabel label text label set label for item label set displayed mnemonic mnemonic this add item label item
added to allow a mnemonic
public void add item string label text jcomponent item jlabel label new jlabel label text this add item label item
this method adds a labelled item to the panel
private void populate mappings list names mapping manager get names collections sort names mapping names combo set model new default combo box model names to array
get a list of all mapping names and populate the mapping name combobox
private void populate use this mapping names use this mapping combo remove all items for int i 0 i mapping names size i use this mapping combo add item mapping names get i use this mapping combo remove item mapping names combo get selected item
populates the database and version combobox that indicates which mapping
private void display if data type mapping null return nothing to display string jdbc type string jdbc types list get selected value default list model list model new default list model if jdbc type null string database types data type mapping get jdbc type if database types null vector temp utilities get vector from list database types mapping delimiter for int i 0 i temp size i list model add element temp get i database type list set model list model
for the currently selected jdbc type display the mapping
private void save save current mapping save the current mapping the current jdbc type to database specific type mapping mapping manager save data type mapping save the current mapping object mapping manager save all
save the current code mapping code object
public void state changed change event e if e get source j tabbed pane string title j tabbed pane get title at j tabbed pane get selected index if title null title equals table jtabbed pane data tab title if data tab built j tabbed pane build data tab data tab built true else if title null title equals table jtabbed pane script tab title if script tab built j tabbed pane build script tab script tab built true
invoked when j tabbed pane has changed its state i
public void allow next boolean allow next action set enabled allow
allow a next action i
public void allow previous boolean allow previous action set enabled allow
allow a previous action i
public sqlresult execute throws sqlexception return execute get document text
execute the current sql statement and return the results in the
public void set auto commit boolean auto commit throws sqlexception if con null con set auto commit auto commit
enable disable autocommit
private string get document text string sql null try sql document get text 0 document get length catch bad location exception e return sql
helper to extract the text from the document
public string get sql return get document text
get the current sql
public string get table sql table table return build table sql table
get the create table sql for the specified table
public sqlresult execute string sql throws sqlexception if sql null throw new illegal argument exception sql parameter is null make sure the connection is active if con null con is closed con jdbcconnection manager get user connection get name if con null con is closed throw new sqlexception no connection can be established with the database sqlresult sql result new sqlresult sql result execute sql con create statement remember sqlstatement sql return sql result
execute the supplied sql statement and return the results in the
private void remember sqlstatement string sql sql statements add sql sql statement iterator scrollable list iterator factory iterator sql statements sql statement iterator last sql statement iterator next last iteration last
remember the successfully executed sql statement so that it can be scrolled
public boolean first sqlstatement boolean result sql statement iterator first if result string s string sql statement iterator next update document s last iteration first return result
move to the first sql statement
public boolean previous sqlstatement boolean result sql statement iterator has previous if result string s string sql statement iterator previous if last iteration next last iteration last s string sql statement iterator previous update document s result sql statement iterator has previous last iteration previous return result
move to the previous sql statement
public boolean last sqlstatement boolean result sql statement iterator last if result string s string sql statement iterator next update document s last iteration last return result
move to the last sql statement
public void internal frame closed internal frame event e db2 dbapplication instance get log debug transfer jinternal frame class closing cleaning up resources clean up any resources
invoked when an internal frame has been closed
public void clear sql try document remove 0 document get length catch bad location exception e
clear the sql statement
public void clear mapping clear
clear this mapping of all entries
private void update document string sql try document remove 0 document get length add new document insert string 0 sql new simple attribute set catch javax swing text bad location exception e app get log error this get class e
helper to update the document with the string
public map get mapping return new hash map mapping
get a copy of this mappings keys and values
public string get generic jdbctype int jdbc type database meta data if jdbc type java sql types other makes no sense return null string generic jdbctype null string key string value of jdbc type if mapping contains key key generic jdbctype string mapping get key else generic jdbctype discover generic jdbctype jdbc type meta data if generic jdbctype null mapping put key generic jdbctype return generic jdbctype
get a generic jdbc type for the specified non standard jdbc type
public table model get table model if table model null construct table model return table model
get a code table model code representing the data held
public float get query exection time return query execution time
how long did the last executed query time take to execute
public string get generic jdbctype column column database meta data return discover generic jdbctype column get table name column get name meta data
get a generic jdbc type for the supplied column
public boolean result set produced return rs produced
did the last query produce a resultset
private void construct table model if data null data new object 0 0 if names null names new object 0 table model new default table model data names
construct the code table model code
public string get rbstring string key return get resources get string key
convenience method to get a code string code from the applications
public void exit get main jframe set visible false jdbcconnection manager close all force closure of any open connections preferences prefs get preferences prefs set app location get main jframe get location remember location prefs set app size get main jframe get size remember size save preferences prefs save preferences system exit 0
clean up and then exit
public void internal frame closed internal frame event e app get log debug query builder jinternal frame class closing cleaning up resources clean up any resources sql builder close
invoked when an internal frame has been closed
public string set string jdbc type string mapping string return string mapping put jdbc type mapping string
set the mapping for the specified jdbc type
public void set source user connection u connection source u connection try source data database cache get u connection catch sqlexception e app get log error this get class e set transfer metadata
set the source database
private int get max string map throws number format exception return integer parse int map substring map index of 1 map index of
get the max argument from the map e
public void set target user connection u connection target u connection tables created this session new array list try target data database cache get u connection catch sqlexception e app get log error this get class e set transfer metadata
set the target database
public void add table table table throws invalid transfer criteria exception if tables key set contains table get name throw new invalid transfer criteria exception db2 dbapplication instance get rbstring db2db transfer transfer metadata allready transferring table tables put table get name table
transfer this code table code object
public iterator table iterator return tables values iterator
get an code iterator code over the tables to be transferred
public list get tables return new array list tables values
get the tables to be transferred
public table get table string name table table null if tables contains key name table table tables get name return table
get the code table code object with the specified name
public user connection get target return target
get the target database
public list get table names return new array list tables key set
get the names of the tables to be transferred
private int get min string map throws number format exception return integer parse int map substring map index of 1 map index of
get the min argument from the map e
public int get primary key count primary key count 0 for iterator i tables values iterator i has next empty if table i next get primary key attributes size 0 primary key count return primary key count
get the number of primary keys to be transferred
public user connection get source return source
get the source database
public void remove table string table throws invalid transfer criteria exception object obj tables remove table if obj null throw new invalid transfer criteria exception db2 dbapplication instance get rbstring db2db transfer transfer metadata table does not exist
do not transfer the specified table
public void remove tables list table names throws invalid transfer criteria exception for iterator i table names iterator i has next remove table i next to string
do not transfer the specified tables
public void set from schema string schema from schema schema tables created this session new array list
set the schema that tables are being transferred from
private void save mappings target mapping mapping manager save target mapping
save the target mapping
public void set to schema string schema to schema schema
set the schema that tables are being transferred to
public void finish try if source conn null jdbcconnection manager release source source conn catch sqlexception e app get log error this get class e mapping manager save all
release any resources cleanly
private string get alternative jdbctype string type return string alternative jdbctypes get string value of type
get an alternative jdbc type to the speicfied type