Skip to content

Commit

Permalink
Fix | Renaming some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rene-ye committed Jul 4, 2019
1 parent 36a5343 commit e94d708
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Provides an interface used to create classes that read in data from any source (such as a file) and allows a
* SQLServerBulkCopy class to write the data to SQL Server tables.
*
* This interface is implemented by {@link SQLServerBulkCommon} Class
* This interface is implemented by {@link SQLServerBulkRecord} Class
*/
public interface ISQLServerBulkRecord extends Serializable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Provides a simple implementation of the ISQLServerBulkRecord interface that can be used to read in the basic Java
* data types from an ArrayList of Parameters that were provided by pstmt/cstmt.
*/
public class SQLServerBulkBatchInsertRecord extends SQLServerBulkCommon {
public class SQLServerBulkBatchInsertRecord extends SQLServerBulkRecord {

/**
* Update serialVersionUID when making changes to this file
Expand All @@ -45,8 +45,7 @@ public class SQLServerBulkBatchInsertRecord extends SQLServerBulkCommon {
*/
public SQLServerBulkBatchInsertRecord(ArrayList<Parameter[]> batchParam, ArrayList<String> columnList,
ArrayList<String> valueList, String encoding) throws SQLServerException {
super.loggerExternal = java.util.logging.Logger.getLogger(loggerPackageName);
super.loggerPackageName = "com.microsoft.sqlserver.jdbc.SQLServerBulkBatchInsertRecord";
initLoggerResources();
if (loggerExternal.isLoggable(java.util.logging.Level.FINER)) {
loggerExternal.entering(loggerPackageName, loggerClassName,
new Object[] {batchParam, encoding});
Expand All @@ -68,6 +67,10 @@ public SQLServerBulkBatchInsertRecord(ArrayList<Parameter[]> batchParam, ArrayLi
loggerExternal.exiting(loggerPackageName, loggerClassName);
}

private void initLoggerResources() {
super.loggerPackageName = "com.microsoft.sqlserver.jdbc.SQLServerBulkBatchInsertRecord";
}

private Object convertValue(ColumnMetadata cm, Object data) throws SQLServerException {
switch (cm.columnType) {
case Types.INTEGER: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Provides a simple implementation of the ISQLServerBulkRecord interface that can be used to read in the basic Java
* data types from a delimited file where each line represents a row of data.
*/
public class SQLServerBulkCSVFileRecord extends SQLServerBulkCommon implements java.lang.AutoCloseable {
public class SQLServerBulkCSVFileRecord extends SQLServerBulkRecord implements java.lang.AutoCloseable {
/**
* Update serialVersionUID when making changes to this file
*/
Expand Down Expand Up @@ -196,7 +196,6 @@ private void initFileReader(InputStreamReader sr, String encoding, String demlim

private void initLoggerResources() {
super.loggerPackageName = "com.microsoft.sqlserver.jdbc.SQLServerBulkCSVFileRecord";
super.loggerExternal = java.util.logging.Logger.getLogger(loggerPackageName);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.Map.Entry;


abstract class SQLServerBulkCommon implements ISQLServerBulkRecord {
abstract class SQLServerBulkRecord implements ISQLServerBulkRecord {

/**
* Update serialVersionUID when making changes to this file
Expand Down Expand Up @@ -62,8 +62,9 @@ protected class ColumnMetadata {
/*
* Logger
*/
protected java.util.logging.Logger loggerExternal = null;
protected String loggerPackageName = "com.microsoft.jdbc.SQLServerBulkCopyCommon";
protected String loggerPackageName = "com.microsoft.jdbc.SQLServerBulkRecord";
protected static java.util.logging.Logger loggerExternal = java.util.logging.Logger
.getLogger("com.microsoft.jdbc.SQLServerBulkRecord");

@Override
public void addColumnMetadata(int positionInSource, String name, int jdbcType, int precision, int scale,
Expand Down

0 comments on commit e94d708

Please sign in to comment.