Java Doc for DataImporter.java in  » Database-Client » SQL-Workbench » workbench » db » importer » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » SQL Workbench » workbench.db.importer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   workbench.db.importer.DataImporter

DataImporter
public class DataImporter implements Interruptable,RowDataReceiver,ProgressReporter,BatchCommitter(Code)
Import data that is provided from a RowDataProducer into a table in the database.
See Also:   workbench.sql.wbcommands.WbImport
See Also:   workbench.sql.wbcommands.WbCopy
See Also:   workbench.db.datacopy.DataCopier
author:
   support@sql-workbench.net


Field Summary
final public static  intMODE_INSERT
    
final public static  intMODE_INSERT_UPDATE
    
final public static  intMODE_UPDATE
    
final public static  intMODE_UPDATE_INSERT
    

Constructor Summary
public  DataImporter()
    

Method Summary
public  voidbeginMultiTable()
    
public  voidcancelExecution()
    
public  voidclearMessages()
    
public  voidcommitNothing()
    
public  booleanconfirmCancel()
    
public  voidcopyMessages(MessageBuffer target)
    
public  voidendMultiTable()
    
public static  intestimateReportIntervalFromFileSize(File file)
    
public  longgetAffectedRows()
    
public  intgetCommitEvery()
    
public  booleangetContinueOnError()
    
public  booleangetDeleteTarget()
    
public  longgetInsertedRows()
    
public  CharSequencegetMessages()
     Return the messages generated during import.
public static  intgetModeValue(String mode)
     Return the numer mode value based on keywords.
public  RowDataProducergetProducer()
    
public  StringgetTargetSchema()
    
public  longgetUpdatedRows()
    
public  booleangetUseBatch()
    
public  booleanhasWarnings()
    
public  voidimportCancelled()
    
public  voidimportFinished()
    
public static  booleanisDeleteTableAllowed(int mode)
    
public  booleanisModeInsert()
    
public  booleanisModeInsertUpdate()
    
public  booleanisModeUpdate()
    
public  booleanisModeUpdateInsert()
    
public  booleanisRunning()
    
public  booleanisSuccess()
    
public  voidnextRowSkipped()
    
public  voidprocessRow(Object[] row)
     Callback function for RowDataProducer.
public  voidrecordRejected(String record)
    
public  voidsetBadfileName(String fname)
    
public  voidsetBatchSize(int size)
    
public  voidsetCommitBatch(boolean flag)
    
public  voidsetCommitEvery(int aCount)
     Set the commit interval.
public  voidsetConnection(WbConnection aConn)
    
public  voidsetConstantColumnValues(ConstantColumnValues constantValues)
     Define column constants for the import.
public  voidsetContinueOnError(boolean flag)
    
public  voidsetCreateTarget(boolean flag)
     Controls creation of target table for imports where the producer can retrieve a full table definition (i.e.
public  voidsetCurrentTable(int current)
    
public  voidsetDeleteTarget(boolean deleteTarget)
     Controls deletion of the target table.
public  voidsetEndRow(long row)
    
public  voidsetKeyColumns(String aColumnList)
    
public  voidsetKeyColumns(List<ColumnIdentifier> cols)
     Set the key columns for the target table to be used for update mode.
public  voidsetMode(int mode)
    
public  booleansetMode(String mode)
     Define the mode by supplying keywords.
public  voidsetModeInsert()
    
public  voidsetModeInsertUpdate()
    
public  voidsetModeUpdate()
    
public  voidsetModeUpdateInsert()
    
public  voidsetPerTableStatements(TableStatements stmt)
     Define statements that should be executed before an import for a table starts and after the last record has been inserted.
Parameters:
  stmt - the statement definitions.
public  voidsetProducer(RowDataProducer producer)
    
public  voidsetReportInterval(int interval)
    
public  voidsetRowActionMonitor(RowActionMonitor rowMonitor)
    
public  voidsetStartRow(long row)
    
public  voidsetTableCount(int total)
    
public  voidsetTargetSchema(String targetSchema)
    
public  voidsetTargetTable(TableIdentifier table, ColumnIdentifier[] columns)
    
public  voidsetTransactionControl(boolean flag)
    
public  voidsetUseBatch(boolean flag)
    
public  voidsetUseTruncate(boolean flag)
    
public  voidsetWhereClauseForUpdate(String clause)
    
public  booleanshouldProcessNextRow()
    
public  voidstartBackgroundImport()
    
public  voidstartImport()
    
public  voidtableImportError()
    

Field Detail
MODE_INSERT
final public static int MODE_INSERT(Code)



MODE_INSERT_UPDATE
final public static int MODE_INSERT_UPDATE(Code)



MODE_UPDATE
final public static int MODE_UPDATE(Code)



MODE_UPDATE_INSERT
final public static int MODE_UPDATE_INSERT(Code)




Constructor Detail
DataImporter
public DataImporter()(Code)




Method Detail
beginMultiTable
public void beginMultiTable()(Code)



cancelExecution
public void cancelExecution()(Code)



clearMessages
public void clearMessages()(Code)



commitNothing
public void commitNothing()(Code)
Do not commit any changes after finishing the import



confirmCancel
public boolean confirmCancel()(Code)
This method is called if cancelExecution() is called to check if the user should confirm the cancelling of the import



copyMessages
public void copyMessages(MessageBuffer target)(Code)



endMultiTable
public void endMultiTable()(Code)



estimateReportIntervalFromFileSize
public static int estimateReportIntervalFromFileSize(File file)(Code)



getAffectedRows
public long getAffectedRows()(Code)



getCommitEvery
public int getCommitEvery()(Code)



getContinueOnError
public boolean getContinueOnError()(Code)



getDeleteTarget
public boolean getDeleteTarget()(Code)



getInsertedRows
public long getInsertedRows()(Code)



getMessages
public CharSequence getMessages()(Code)
Return the messages generated during import. Calling this, clears the message buffer the message buffer.
See Also:   workbench.util.MessageBuffer.getBuffer



getModeValue
public static int getModeValue(String mode)(Code)
Return the numer mode value based on keywords. Valid mode definitions are:
  • insert
  • update
  • insert,update
  • update,insert
The mode string is not case sensitive (INSERT is the same as insert) -1 if the value is not valid
See Also:   DataImporter.getModeValue(String)
See Also:   DataImporter.MODE_INSERT
See Also:   DataImporter.MODE_UPDATE
See Also:   DataImporter.MODE_INSERT_UPDATE
See Also:   DataImporter.MODE_UPDATE_INSERT



getProducer
public RowDataProducer getProducer()(Code)



getTargetSchema
public String getTargetSchema()(Code)



getUpdatedRows
public long getUpdatedRows()(Code)



getUseBatch
public boolean getUseBatch()(Code)



hasWarnings
public boolean hasWarnings()(Code)



importCancelled
public void importCancelled()(Code)



importFinished
public void importFinished()(Code)
Callback from the RowDataProducer



isDeleteTableAllowed
public static boolean isDeleteTableAllowed(int mode)(Code)



isModeInsert
public boolean isModeInsert()(Code)



isModeInsertUpdate
public boolean isModeInsertUpdate()(Code)



isModeUpdate
public boolean isModeUpdate()(Code)



isModeUpdateInsert
public boolean isModeUpdateInsert()(Code)



isRunning
public boolean isRunning()(Code)



isSuccess
public boolean isSuccess()(Code)



nextRowSkipped
public void nextRowSkipped()(Code)



processRow
public void processRow(Object[] row) throws SQLException(Code)
Callback function for RowDataProducer. The order in the data array has to be the same as initially passed in the setTargetTable() method.



recordRejected
public void recordRejected(String record)(Code)



setBadfileName
public void setBadfileName(String fname)(Code)



setBatchSize
public void setBatchSize(int size)(Code)



setCommitBatch
public void setCommitBatch(boolean flag)(Code)



setCommitEvery
public void setCommitEvery(int aCount)(Code)
Set the commit interval. When this parameter is set, commitBatch is set to false.
Parameters:
  aCount - the interval in which commits should be sent



setConnection
public void setConnection(WbConnection aConn)(Code)



setConstantColumnValues
public void setConstantColumnValues(ConstantColumnValues constantValues)(Code)
Define column constants for the import. It is expected that the value object is already converted to the correct class. DataImporter will not convert the passed values in any way.



setContinueOnError
public void setContinueOnError(boolean flag)(Code)



setCreateTarget
public void setCreateTarget(boolean flag)(Code)
Controls creation of target table for imports where the producer can retrieve a full table definition (i.e. XML files created with SQL Workbench)
See Also:   DataImporter.createTarget()
See Also:   DataImporter.setTargetTable(workbench.db.TableIdentifier,workbench.db.ColumnIdentifier[])



setCurrentTable
public void setCurrentTable(int current)(Code)



setDeleteTarget
public void setDeleteTarget(boolean deleteTarget)(Code)
Controls deletion of the target table.



setEndRow
public void setEndRow(long row)(Code)



setKeyColumns
public void setKeyColumns(String aColumnList)(Code)
Define the key columns by supplying a comma separated list of column names



setKeyColumns
public void setKeyColumns(List<ColumnIdentifier> cols)(Code)
Set the key columns for the target table to be used for update mode. The list has to contain objects of type workbench.db.ColumnIdentifier



setMode
public void setMode(int mode)(Code)



setMode
public boolean setMode(String mode)(Code)
Define the mode by supplying keywords. true if the passed string is valid, false otherwise
See Also:   DataImporter.getModeValue(String)



setModeInsert
public void setModeInsert()(Code)



setModeInsertUpdate
public void setModeInsertUpdate()(Code)



setModeUpdate
public void setModeUpdate()(Code)



setModeUpdateInsert
public void setModeUpdateInsert()(Code)



setPerTableStatements
public void setPerTableStatements(TableStatements stmt)(Code)
Define statements that should be executed before an import for a table starts and after the last record has been inserted.
Parameters:
  stmt - the statement definitions. May be null



setProducer
public void setProducer(RowDataProducer producer)(Code)



setReportInterval
public void setReportInterval(int interval)(Code)



setRowActionMonitor
public void setRowActionMonitor(RowActionMonitor rowMonitor)(Code)



setStartRow
public void setStartRow(long row)(Code)



setTableCount
public void setTableCount(int total)(Code)



setTargetSchema
public void setTargetSchema(String targetSchema)(Code)



setTargetTable
public void setTargetTable(TableIdentifier table, ColumnIdentifier[] columns) throws SQLException(Code)
Callback function from the RowDataProducer



setTransactionControl
public void setTransactionControl(boolean flag)(Code)



setUseBatch
public void setUseBatch(boolean flag)(Code)
Use batch updates if the driver supports this



setUseTruncate
public void setUseTruncate(boolean flag)(Code)



setWhereClauseForUpdate
public void setWhereClauseForUpdate(String clause)(Code)



shouldProcessNextRow
public boolean shouldProcessNextRow()(Code)



startBackgroundImport
public void startBackgroundImport()(Code)



startImport
public void startImport() throws IOException, SQLException, Exception(Code)
Start the import



tableImportError
public void tableImportError()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.