Package xregistry.context

Examples of xregistry.context.SqlParam


                statement.setString(2, user);
                statement.executeUpdate();

                statement = connection.prepareStatement(sql);
                for (int i = 0; i < sqlParams.length; i++) {
                    SqlParam param = sqlParams[i];
                    switch (param.getType()) {
                    case Int:
                        statement.setInt(i + 1, Integer.parseInt(param.getValue()));
                        break;
                    case String:
                        statement.setString(i + 1, param.getValue());
                        break;
                    case Long:
                        statement.setLong(i + 1, Long.parseLong(param.getValue()));
                        break;
                    default:
                        throw new XregistryException("Unknown SQL param type " + param.getType());
                    }
                }
                statement.executeUpdate();
                log.info("Execuate SQL " + statement);
                connection.commit();
View Full Code Here


     */
    public String registerHostDesc(String user, String hostDescAsStr) throws XregistryException {
        String hostName = DocParser.parseHostDesc(hostDescAsStr);
        String resourceID = ResourceUtils.getResourceID(DocType.HostDesc,hostName);
        return registerResource(user, resourceID, ADD_HOST_DESC_SQL, new SqlParam[] {
                new SqlParam(resourceID), new SqlParam(hostName), new SqlParam(hostDescAsStr) });
    }
View Full Code Here

        String resourceID = ResourceUtils.getResourceID(DocType.ServiceDesc,serviceName);
        // INSERT INTO
        // service_map_table(resourceid,qname,servicemap_str,appname,awsdl_str)
        // VALUES (?, ?,?,?,?)
        return registerResource(user, resourceID, ADD_SERVICE_DESC_SQL, new SqlParam[] {
                new SqlParam(resourceID), new SqlParam(serviceName),
                new SqlParam(serviceDescAsStr), new SqlParam(awsdlAsStr) });
    }
View Full Code Here

        String resourceID = ResourceUtils.getResourceID(DocType.AppDesc, appName,hostName );
       
        // INSERT INTO appdesc_table(resourceid,qname,host_name,appdesc_str)
        // VALUES (?, ?, ?, ?)
        return registerResource(user, resourceID, ADD_APP_DESC_SQL, new SqlParam[] {
                new SqlParam(resourceID), new SqlParam(appName), new SqlParam(hostName),
                new SqlParam(appDescAsStr) });
    }
View Full Code Here

                // VALUES (?, ?, ?, ?, ?, ?)
                //if CWSDL is alredy there, delete it
                removeResource(resourceID, DELETE_CWSDL_SQL, new String[]{wsdlQname.toString()});
                //Add CWSDL
                return registerResource(user, resourceID, ADD_CWSDL_SQL, new SqlParam[] {
                        new SqlParam(resourceID), new SqlParam(wsdlQname.toString()),
                        new SqlParam(wsdlAsStr),
                        new SqlParam(String.valueOf(System.currentTimeMillis()), SqlParmType.Long),
                        new SqlParam(String.valueOf(lifetimeAsSeconds*1000), SqlParmType.Int),
                        new SqlParam(portTypeName.toString()) });
            } else {
                throw new XregistryException(
                        "WSDL must be a concreate WSDL, it must have service defined");
            }
        } catch (WSDLException e) {
View Full Code Here

        }
    }

    public void registerDocument(String user, QName resourceID, String document) throws XregistryException {
        registerResource(user, resourceID.toString(), ADD_DOC_SQL, new SqlParam[] {
                new SqlParam(resourceID.toString()), new SqlParam(document) });
    }
View Full Code Here

    }

    public void registerOGCEResource(String user, QName resourceID, String resourceName, String resourceType, String resourceDesc, String resoureDocument, String resoureParentTypedID) throws XregistryException {
      String resourceIdString = ResourceUtils.getOGCEResourceID(resourceType, new String[]{resourceID.toString()});
      registerResource(user, resourceIdString, ADD_OGCE_RESOURCE_SQL, new SqlParam[] {
                new SqlParam(resourceIdString)new SqlParam(resourceName), new SqlParam(resourceType), new SqlParam(resourceDesc) ,new SqlParam(resoureDocument), new SqlParam(resoureParentTypedID) });
    }
View Full Code Here

TOP

Related Classes of xregistry.context.SqlParam

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.