本文整理汇总了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() ) ;
*/
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}