当前位置: 首页>>代码示例>>Java>>正文


Java SQLException.getLocalizedMessage方法代码示例

本文整理汇总了Java中java.sql.SQLException.getLocalizedMessage方法的典型用法代码示例。如果您正苦于以下问题:Java SQLException.getLocalizedMessage方法的具体用法?Java SQLException.getLocalizedMessage怎么用?Java SQLException.getLocalizedMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.sql.SQLException的用法示例。


在下文中一共展示了SQLException.getLocalizedMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reportDatabaseError

import java.sql.SQLException; //导入方法依赖的package包/类
private void reportDatabaseError(SQLException e) {

        Log.getLogger().log(Level.FINE, null, e);
        
        String msg = isUnsupportedFeature(e)
	    ? NbBundle.getMessage(QueryBuilder.class, "UNSUPPORTED_FEATURE")
	    : e.getLocalizedMessage();
        
        reportProcessingError(msg);

        /*
        ConnectionStatusPanel csp = new ConnectionStatusPanel() ;
        csp.configureDisplay(sqlStatement.getConnectionInfo(), false, e.getLocalizedMessage(),  "", 0, false ) ;
        csp.setGeneralInfo(msg) ;
        csp.displayDialog( sqlStatement.getConnectionInfo() ) ;
        */

    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:QueryBuilder.java

示例2: doGet

import java.sql.SQLException; //导入方法依赖的package包/类
/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
  List<String> sourceList = Arrays.asList("SAUCE_LABS", "BROWSER_STACK", "TESTING_BOT");

  try {
    List<Object> compabilities = new ArrayList<>();
    for (String source : sourceList)
      compabilities
          .add(new CompatibilityDao(Utility.getCompDBConnection(this.getServletContext()))
              .getCompabilityList(source));
    request.setAttribute("compabilityList", compabilities);
  } catch (SQLException e) {
    e.printStackTrace();
    throw new KiteSQLException(e.getLocalizedMessage());
  }

  // get UI
  if (log.isDebugEnabled())
    log.debug("Displaying: configurator.vm");
  RequestDispatcher requestDispatcher = request.getRequestDispatcher("configurator.vm");
  requestDispatcher.forward(request, response);
}
 
开发者ID:webrtc,项目名称:KITE,代码行数:26,代码来源:ConfiguratorServlet.java

示例3: doGet

import java.sql.SQLException; //导入方法依赖的package包/类
/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {


    List<ClientVersion> clientVersionList;
    try {
        clientVersionList =
                new ClientVersionDao(Utility.getDBConnection(this.getServletContext())).getClientVersionList();
        if (log.isDebugEnabled())
            log.debug("out->: clientVersionList" + clientVersionList);
        request.setAttribute("clientVersionList", clientVersionList);
    } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        throw new KiteSQLException(e.getLocalizedMessage());
    }

    // get UI
    if (log.isDebugEnabled())
        log.debug("Displaying: client_version.vm");
    RequestDispatcher requestDispatcher = request.getRequestDispatcher("client_version.vm");
    requestDispatcher.forward(request, response);
}
 
开发者ID:webrtc,项目名称:KITE,代码行数:27,代码来源:ClientVersionServlet.java

示例4: getSqlExecuteUpdate

import java.sql.SQLException; //导入方法依赖的package包/类
/**
 * This Method executes a SQL-Statement (Create, Insert, Update) in
 * the database and returns true if this was successful 
 * @param sqlStatement the SQL-Statement to execute
 * @return True, if the execution was successful
 */
public boolean getSqlExecuteUpdate(String sqlStatement) {
	
	boolean successfull = false;
	Statement state = null;
	try {
		state = getNewStatement();
		state.executeUpdate(sqlStatement);
		successfull = true;
		
	} catch (SQLException e) {
		//e.printStackTrace();
		String msg = e.getLocalizedMessage() + newLine;
		msg += sqlStatement;
		this.dbError.setText(msg);
		this.dbError.put2Clipboard(sqlStatement);
		this.dbError.setErrNumber( e.getErrorCode() );
		this.dbError.setHead( "Fehler bei der Ausführung von 'executeUpdate'!" );
		this.dbError.setErr(true);
		this.dbError.show();
		
	} finally {
		try {
			if (state!=null) state.close();
		} catch (SQLException sqle) {
			sqle.printStackTrace();
		}
	}
	return successfull;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:36,代码来源:DBConnection.java

示例5: doGet

import java.sql.SQLException; //导入方法依赖的package包/类
/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
  // TODO Auto-generated method stub
  // response.getWriter().append("Served at:
  // ").append(request.getContextPath());

  String configName = request.getParameter("name");
  if (configName == null)
    throw new KiteNoKeyException("name");
  if (log.isDebugEnabled())
    log.debug("in->name: " + configName);

  List<ConfigExecution> listOfExecution;
  List<ConfigTest> listOfDistinctTest;
  try {
    listOfDistinctTest = new ConfigTestDao(Utility.getDBConnection(this.getServletContext())).getTestList();
    request.setAttribute("listOfTest", listOfDistinctTest);
    listOfExecution = new ConfigExecutionDao(Utility.getDBConnection(this.getServletContext()))
            .getConfigExecutionList(configName);
    if (log.isDebugEnabled())
      log.debug("out->listOfExecution: " + listOfExecution);
    request.setAttribute("listOfExecution", listOfExecution);
  } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    throw new KiteSQLException(e.getLocalizedMessage());
  }

  // get UI
  if (log.isDebugEnabled())
    log.debug("Displaying: execution.vm");
  RequestDispatcher requestDispatcher = request.getRequestDispatcher("execution.vm");
  requestDispatcher.forward(request, response);
}
 
开发者ID:webrtc,项目名称:KITE,代码行数:38,代码来源:ExecutionServlet.java

示例6: getInt

import java.sql.SQLException; //导入方法依赖的package包/类
@Override
public int getInt(String columnName) throws WrapperAccessException {
    try {
        return rs.getInt(columnName);
    } catch (SQLException ex) {
        throw new WrapperAccessException(ex.getLocalizedMessage(), ex);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:9,代码来源:SQLResultSetWrapper.java

示例7: doGet

import java.sql.SQLException; //导入方法依赖的package包/类
/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {


  List<Score> scoreList= new ArrayList<Score>();
  List<ConfigTest> listOfDistinctTest;
  try {
    listOfDistinctTest = new ConfigTestDao(Utility.getDBConnection(this.getServletContext())).getTestList();
    for (ConfigTest test: listOfDistinctTest){
      Long lastRun = new PublicOverviewDao(Utility.getDBConnection(this.getServletContext())).getRunList(test.getTestName()).get(0);
      OverviewResult tmp = new OverviewResult(
              new ResultTableDao(Utility.getDBConnection(this.getServletContext())).getResultList("TN"+test.getTestName()+"_"+lastRun.toString(), test.getTupleSize()));
      //OverviewResult tmp = new OverviewResult(new OverviewDao(Utility.getDBConnection(this.getServletContext())).getOverviewResultList(test.getTestName(), test.getTupleSize()),true);
      tmp.stableFilter();
      Score tmpScore= new Score(test, tmp);
      scoreList.add(tmpScore);
    }
    String scoreJson="{";
    for (Score score:scoreList){
      scoreJson+="\""+score.getTestName()+"\":";
      scoreJson+=score.getScoreJson();
      if (scoreList.indexOf(score)<scoreList.size()-1) {
        scoreJson+=",";
      }
    }
    scoreJson+="}";
    request.setAttribute("scoreJson", scoreJson);
  } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    throw new KiteSQLException(e.getLocalizedMessage());
  }

  if (log.isDebugEnabled())
    log.debug("Displaying: score.vm");
  RequestDispatcher requestDispatcher = request.getRequestDispatcher("score.vm");
  requestDispatcher.forward(request, response);
}
 
开发者ID:webrtc,项目名称:KITE,代码行数:42,代码来源:ScoreBoardServlet.java

示例8: doGet

import java.sql.SQLException; //导入方法依赖的package包/类
/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {

  List<ConfigurationOverall> listOfConfig;
  List<Browser> listOfBrowser;
  List<ConfigTest> listOfDistinctTest;
  try {
    listOfDistinctTest = new ConfigTestDao(Utility.getDBConnection(this.getServletContext())).getTestList();
    request.setAttribute("listOfTest", listOfDistinctTest);
    listOfConfig = new ConfigExecutionDao(Utility.getDBConnection(this.getServletContext()))
            .getDistinctConfigExecutionList();
    listOfBrowser = new BrowserDao(Utility.getDBConnection(this.getServletContext()))
            .getBrowserList();
    listOfBrowser = new ArrayList<Browser>(new LinkedHashSet<Browser>(listOfBrowser));
    if (log.isDebugEnabled())
      log.debug("out->listOfConfigName: " + listOfConfig);
    request.setAttribute("listOfConfig", listOfConfig);
    request.setAttribute("listOfBrowser", listOfBrowser);
  } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    throw new KiteSQLException(e.getLocalizedMessage());
  }

  // get UI
  if (log.isDebugEnabled())
    log.debug("Displaying: dashboard.vm");
  RequestDispatcher requestDispatcher = request.getRequestDispatcher("dashboard.vm");
  requestDispatcher.forward(request, response);
}
 
开发者ID:webrtc,项目名称:KITE,代码行数:34,代码来源:DashboardServlet.java

示例9: hasAllHelpers

import java.sql.SQLException; //导入方法依赖的package包/类
public boolean hasAllHelpers() throws IOException {
    // just makes new connection for now
    // smarter solution would be to make the class AutoCloseable
    try (Connection c = connector.getConnection()) {
        return JdbcReaderFactory.getAvailableHelperBits(c) == JdbcReaderFactory.getAllHelperBits();
    } catch (SQLException ex) {
        throw new IOException(ex.getLocalizedMessage(), ex);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:10,代码来源:JdbcLoader.java

示例10: getDouble

import java.sql.SQLException; //导入方法依赖的package包/类
@Override
public double getDouble(String columnName) throws WrapperAccessException {
    try {
        return rs.getDouble(columnName);
    } catch (SQLException ex) {
        throw new WrapperAccessException(ex.getLocalizedMessage(), ex);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:9,代码来源:SQLResultSetWrapper.java

示例11: getLong

import java.sql.SQLException; //导入方法依赖的package包/类
@Override
public long getLong(String columnName) throws WrapperAccessException {
    try {
        return rs.getLong(columnName);
    } catch (SQLException ex) {
        throw new WrapperAccessException(ex.getLocalizedMessage(), ex);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:9,代码来源:SQLResultSetWrapper.java

示例12: getShort

import java.sql.SQLException; //导入方法依赖的package包/类
@Override
public short getShort(String columnName) throws WrapperAccessException {
    try {
        return rs.getShort(columnName);
    } catch (SQLException ex) {
        throw new WrapperAccessException(ex.getLocalizedMessage(), ex);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:9,代码来源:SQLResultSetWrapper.java

示例13: getString

import java.sql.SQLException; //导入方法依赖的package包/类
@Override
public String getString(String columnName) throws WrapperAccessException {
    try {
        return rs.getString(columnName);
    } catch (SQLException ex) {
        throw new WrapperAccessException(ex.getLocalizedMessage(), ex);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:9,代码来源:SQLResultSetWrapper.java

示例14: getFloat

import java.sql.SQLException; //导入方法依赖的package包/类
@Override
public float getFloat(String columnName) throws WrapperAccessException {
    try {
        return rs.getFloat(columnName);
    } catch (SQLException ex) {
        throw new WrapperAccessException(ex.getLocalizedMessage(), ex);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:9,代码来源:SQLResultSetWrapper.java

示例15: getArray

import java.sql.SQLException; //导入方法依赖的package包/类
@Override
public <T> T[] getArray(String columnName, Class<T> arrayElement) throws WrapperAccessException {
    try {
        Array arr = rs.getArray(columnName);
        if (arr != null) {
            @SuppressWarnings("unchecked")
            T[] ret = (T[]) arr.getArray();
            return ret;
        }
        return null;
    } catch (SQLException ex) {
        throw new WrapperAccessException(ex.getLocalizedMessage(), ex);
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:15,代码来源:SQLResultSetWrapper.java


注:本文中的java.sql.SQLException.getLocalizedMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。