Examples of SqlResourceException


Examples of org.restsql.core.SqlResourceException

      statement = connection.createStatement();
      ResultSet resultSet = statement.executeQuery(sql);
      resultSet.next();
      return resultSet.getInt(1);
    } catch (final SQLException exception) {
      throw new SqlResourceException(exception, sql);
    } finally {
      if (statement != null) {
        try {
          statement.close();
        } catch (SQLException e) {
View Full Code Here

Examples of org.restsql.core.SqlResourceException

        response.addRow(responseValues);
      }
      response.addRowsAffected(rowsAffected);

    } catch (final SQLException exception) {
      throw new SqlResourceException(exception);
    } finally {
      if (connection != null) {
        try {
          connection.close();
        } catch (final SQLException ignored) {
View Full Code Here

Examples of org.restsql.core.SqlResourceException

        }
      }
      resultSet.close();
      statement.close();
    } catch (final SQLException exception) {
      throw new SqlResourceException(exception, sqlStruct.getStatement());
    } finally {
      if (connection != null) {
        try {
          connection.close();
        } catch (final SQLException ignored) {
View Full Code Here

Examples of org.restsql.core.SqlResourceException

            }
          }
          rowsAffected = statement.executeUpdate();
          statement.close();
        } catch (final SQLException exception) {
          throw new SqlResourceException(exception, sqlStruct.getStatement());
        }
      }
    }
    return rowsAffected;
  }
View Full Code Here

Examples of org.restsql.core.SqlResourceException

      if (printAction) {
        System.out.println("\t[setUp] " + sql);
      }
      statement.executeQuery(sql);
    } catch (final SQLException exception) {
      throw new SqlResourceException(exception, sql);
    } finally {
      if (statement != null) {
        try {
          statement.close();
        } catch (SQLException e) {
View Full Code Here

Examples of org.restsql.core.SqlResourceException

    if (mediaType.equals("application/xml")) {
      return xmlRequestDeserializer;
    } else if (mediaType.equals("application/json")) {
      return jsonRequestDeserializer;
    } else {
      throw new SqlResourceException("No deserializer found for media type " + mediaType);
    }
  }
View Full Code Here

Examples of org.restsql.core.SqlResourceException

      final JSONParser parser = new JSONParser();
      parser.parse(requestBody, handler);
    } catch (final ParseException exception) {
      throw new InvalidRequestException("Error parsing request body: " + exception.toString());
    }
    final SqlResourceException handlerException = handler.getHandlerException();
    if (handlerException != null) {
      throw handlerException;
    }
    return handler.getWriteResponse();
  }
View Full Code Here

Examples of org.restsql.core.SqlResourceException

      buildPrimaryKeys(connection);
      buildInvisibleForeignKeys(connection);
      buildJoinTableMetadata(connection);
      buildSequenceMetaData(connection);
    } catch (final SQLException exception) {
      throw new SqlResourceException(exception, sql);
    } finally {
      if (connection != null) {
        try {
          connection.close();
        } catch (final SQLException ignored) {
View Full Code Here

Examples of org.restsql.core.SqlResourceException

      TableMetaData table = (TableMetaDataImpl) tableMap.get(column.getQualifiedTableName());
      if (table == null) {
        // Create table metadata object and add to special references
        final Table tableDef = SqlResourceDefinitionUtils.getTable(definition, column);
        if (tableDef == null) {
          throw new SqlResourceException("Definition requires table element for "
              + column.getTableName() + ", referenced by column " + column.getColumnLabel());
        }
        table = Factory.getTableMetaData();
        table.setAttributes(tableName, qualifiedTableName, databaseName,
            TableRole.valueOf(tableDef.getRole()));
View Full Code Here

Examples of org.restsql.core.SqlResourceException

      if (printAction) {
        System.out.println("\t[setUp] " + sql);
      }
      statement.executeUpdate(sql);
    } catch (final SQLException exception) {
      throw new SqlResourceException(exception, sql);
    } finally {
      if (statement != null) {
        try {
          statement.close();
        } catch (SQLException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.