Package com.fathomdb.jdbc

Examples of com.fathomdb.jdbc.JdbcConnection


  @Override
  @JdbcTransaction
  public ServiceAuthorization findServiceAuthorization(ServiceType serviceType, ProjectId project)
      throws RepositoryException {
    try {
      JdbcConnection connection = connectionProvider.get();
      int serviceId = JdbcRepositoryHelpers.getServiceKey(connection, serviceType);
      int projectId = JdbcRepositoryHelpers.getProjectKey(connection, project);

      String sql = "SELECT data FROM service_authorizations WHERE service=? and project=?";

      List<ServiceAuthorization> items = Lists.newArrayList();

      PreparedStatement ps = connection.prepareStatement(sql);
      ResultSet rs = null;
      try {
        ps.setInt(1, serviceId);
        ps.setInt(2, projectId);
        rs = ps.executeQuery();
View Full Code Here


  public ServiceAuthorization createAuthorization(ProjectId project, ServiceAuthorization authorization)
      throws RepositoryException {
    try {
      ServiceType serviceType = new ServiceType(authorization.serviceType);

      JdbcConnection connection = connectionProvider.get();
      int serviceId = JdbcRepositoryHelpers.getServiceKey(connection, serviceType);
      int projectId = JdbcRepositoryHelpers.getProjectKey(connection, project);

      final String sql = "INSERT INTO service_authorizations (service, project, data) VALUES (?, ?, ?)";

      PreparedStatement ps = connection.prepareStatement(sql);
      ResultSet rs = null;
      try {
        ps.setInt(1, serviceId);
        ps.setInt(2, projectId);
        ps.setString(3, authorization.data);
View Full Code Here

TOP

Related Classes of com.fathomdb.jdbc.JdbcConnection

Copyright © 2018 www.massapicom. 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.