|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectservicenow.community.sql.TableWriter
public class TableWriter
Used to read or write to a table in an SQL database. The SQL table is maps to a table in a ServiceNow instance. The glidetable property is the ServiceNow table.
Constructor Summary | |
---|---|
TableWriter(DatabaseWriter dbwriter,
GlideTable glidetable,
java.lang.String sqlTableName,
Metrics metrics)
|
Method Summary | |
---|---|
void |
commit()
|
void |
createTable()
Create a table in the target database. |
boolean |
deleteRecord(GlideKey key)
|
java.lang.String |
generateCreateTable()
|
java.lang.String |
generateInsert()
|
java.lang.String |
generateUpdate()
|
Metrics |
getMetrics()
|
GlideDateTime |
getTimestamp(GlideKey key)
Get sys_updated_on from the SQL table so that we can compare it with the Glide Record to determine if the SQL table needs to be updated. |
int |
processRecordSet(GlideRecordList data,
LoadMethod method)
|
void |
setMetrics(Metrics metrics)
|
java.lang.String |
sqlFieldDefinition(GlideFieldDefinition fd)
|
SqlGenerator |
sqlGenerator()
|
boolean |
tableExists()
Determine if a table already exists in the target database. |
void |
truncateTable()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableWriter(DatabaseWriter dbwriter, GlideTable glidetable, java.lang.String sqlTableName, Metrics metrics) throws java.sql.SQLException, PumperException, java.io.IOException, org.jdom2.JDOMException
java.sql.SQLException
PumperException
java.io.IOException
org.jdom2.JDOMException
Method Detail |
---|
public void setMetrics(Metrics metrics)
public Metrics getMetrics()
public SqlGenerator sqlGenerator()
public void truncateTable() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String generateInsert() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String generateUpdate() throws java.sql.SQLException
java.sql.SQLException
public GlideDateTime getTimestamp(GlideKey key) throws java.sql.SQLException, java.text.ParseException
key
- sys_id of record to be retrieved from SQL table
java.sql.SQLException
java.text.ParseException
public boolean deleteRecord(GlideKey key) throws java.sql.SQLException
java.sql.SQLException
public int processRecordSet(GlideRecordList data, LoadMethod method) throws java.text.ParseException, java.io.IOException, org.jdom2.JDOMException, java.sql.SQLException
java.text.ParseException
java.io.IOException
org.jdom2.JDOMException
java.sql.SQLException
public void commit() throws java.sql.SQLException
java.sql.SQLException
public boolean tableExists() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String sqlFieldDefinition(GlideFieldDefinition fd)
public java.lang.String generateCreateTable() throws java.sql.SQLException, java.io.IOException, org.jdom2.JDOMException
java.sql.SQLException
java.io.IOException
org.jdom2.JDOMException
public void createTable() throws java.sql.SQLException, java.io.IOException, org.jdom2.JDOMException
java.sql.SQLException
java.io.IOException
org.jdom2.JDOMException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |