All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.snowflake.client.jdbc.SnowflakeSQLWarning Maven / Gradle / Ivy

There is a newer version: 3.19.0
Show newest version
package net.snowflake.client.jdbc;

import java.sql.SQLWarning;
import java.util.Objects;

import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
import net.snowflake.common.core.ResourceBundleManager;

/**
 * A simple wrapper extends SQLWarning
 *
 * Created by hyu on 2/21/17.
 */
class SnowflakeSQLWarning extends SQLWarning
{
  static final SFLogger logger =
      SFLoggerFactory.getLogger(SnowflakeSQLException.class);

  static private final ResourceBundleManager errorResourceBundleManager =
      ResourceBundleManager.getSingleton(ErrorCode.errorMessageResource);

  SnowflakeSQLWarning(String sqlState, int vendorCode, Object...params)
  {
    super(errorResourceBundleManager.getLocalizedMessage(
        String.valueOf(vendorCode), params), sqlState, vendorCode);

    logger.debug("Snowflake warning: {}, sqlState:{}, vendorCode:{}",
        errorResourceBundleManager.getLocalizedMessage(
            String.valueOf(vendorCode), params),
        sqlState,
        vendorCode);
  }

  SnowflakeSQLWarning(ErrorCode errorCode, Object...params)
  {
    this(errorCode.getSqlState(), errorCode.getMessageCode(), params);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy