There are 5 code examples for java.sql.SQLException.

The API names are highlighted below. You can use suckoo button to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.

Project Name: icTAKES Package: edu.mayo.bmi.dictionary.jdbc

Source Code: JdbcDictionaryImpl.java (Click to view .java file)

Method Code:
vote
like

public Collection getEntries(String str) throws DictionaryException {
  Set metaDataHitSet=new HashSet();
  try {
    PreparedStatement prepStmt=initMetaDataPrepStmt(str);
    ResultSet rs=prepStmt.executeQuery();
    while (rs.next()) {
      Map nameValMap=new HashMap();
      Iterator metaFieldNameItr=getMetaFieldNames();
      while (metaFieldNameItr.hasNext()) {
        String metaFieldName=(String)metaFieldNameItr.next();
        String metaFieldValue=rs.getString(metaFieldName);
        nameValMap.put(metaFieldName,metaFieldValue);
      }
      MetaDataHit mdh=new GenericMetaDataHitImpl(nameValMap);
      metaDataHitSet.add(mdh);
    }
    return metaDataHitSet;
  }
 catch (  SQLException e) {
    throw new DictionaryException(e);
  }
}
 

Project Name: jbidwatcher Package: com.jbidwatcher

Source Code: Upgrader.java (Click to view .java file)

Method Code:
vote
like

private static boolean dbMake(Database db){
  try {
    Statement mS=db.getStatement();
    boolean schema_info_exists=tableExists(mS,"schema_info");
    if (!schema_info_exists)     schema_info_exists=tableExists(mS,"SCHEMA_INFO");
    if (!schema_info_exists) {
      runFile(db,mS,"/jbidwatcher.sql");
      JConfig.setConfiguration("jbidwatcher.created_db","true");
    }
 else {
      JConfig.log().logDebug("Auction information database already exists.");
    }
  }
 catch (  SQLException se) {
    System.err.println(se);
    return false;
  }
  return true;
}
 

Project Name: jbidwatcher Package: com.jbidwatcher.util.db

Source Code: Database.java (Click to view .java file)

Method Code:
vote
like

public PreparedStatement prepare(String statement) throws SQLException {
  try {
    return mConn.prepareStatement(statement,Statement.RETURN_GENERATED_KEYS);
  }
 catch (  SQLException sqe) {
    if (mConn.isClosed() || sqe.getMessage().equals("No current connection.")) {
      try {
        setup();
        return mConn.prepareStatement(statement,Statement.RETURN_GENERATED_KEYS);
      }
 catch (      Exception e) {
        SQLException error=new SQLException("Failed to reconnect due to: " + e.getMessage());
        error.initCause(e);
        throw error;
      }
    }
    throw sqe;
  }
}
 

Project Name: jbidwatcher Package: com.jbidwatcher.util.db

Source Code: Table.java (Click to view .java file)

Method Code:
vote
like

private void establishMetadata(ResultSetMetaData rsmd){
  try {
    mColumnMap=new HashMap<String,TypeColumn>();
    for (int i=1; i <= rsmd.getColumnCount(); i++) {
      String key=rsmd.getColumnName(i).toLowerCase();
      String value=rsmd.getColumnTypeName(i);
      mColumnMap.put(key,new TypeColumn(value,i));
    }
  }
 catch (  SQLException e) {
    JConfig.log().handleException("Can't load metadata for table " + mTableName + ".",e);
  }
}
 

Project Name: openhotelsystem Package: it.hotel.model.abstrakt.manager

Source Code: AbstractDAO.java (Click to view .java file)

Method Code:
vote
like

/** 
 * Esegue un rollback, senza rilanciare eccezioni. 
 * Da usare nel blocco catch di gestione di una eccezione. 
 * @param conn La connessione al db.
 */
protected void executeRollback(Connection conn){
  try {
    if (conn != null)     conn.rollback();
  }
 catch (  SQLException e) {
    SystemUtils.logThrowable(e,this,"executeRollback");
  }
}