Package org.apache.olio.workload.loader.framework

Examples of org.apache.olio.workload.loader.framework.ThreadConnection.prepareStatement()


    }
   
     public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
            PreparedStatement s = c.prepareStatement(STATEMENT);
            for (int i = 0; i < fields.length; i++)
                if (fields[i] != null)
                    s.setString(i + 1, fields[i]);
                else
                    s.setNull(i + 1, Types.VARCHAR);
View Full Code Here


        ThreadConnection c = ThreadConnection.getInstance();
        try {
            //update id
             logger.fine("before updating socialEventID");            
            
             c.prepareStatement("INSERT INTO ID_GEN " +
                    "(GEN_KEY, GEN_VALUE) " +
                    "VALUES ('SOCIAL_EVENT_ID', "+ ScaleFactors.events +1 + ")");
             c.executeUpdate();                         
            
            /*
 
View Full Code Here

    public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
        //    for (String friend : friends) {
        for (Integer friend : friendSet) {
                PreparedStatement s = c.prepareStatement(STATEMENT);
                //s.setString(1, userName);
                //s.setString(2, friend);
        s.setInt(1, id);
        s.setInt(2, friend);
                c.addBatch();
View Full Code Here


    public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
            PreparedStatement s = c.prepareStatement(STATEMENT);
            s.setString(1, tag);
            s.setInt(2, 0); // Initialize it to 0 first, count and add later.
            c.addBatch();
        } catch (SQLException e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

     * So we update the table at postload.
     */
    public void postLoad() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
            c.prepareStatement("update SOCIALEVENTTAG set refcount = " +
                    "(select count(*) from SOCIALEVENTTAG_SOCIALEVENT " +
                    "where socialeventtagid = " +
                    "SOCIALEVENTTAG.socialeventtagid)");
            c.executeUpdate();
            //update id
View Full Code Here

             c.prepareStatement("update ID_GEN set GEN_VALUE = " +
                    "(select count(*) +1 from SOCIALEVENTTAG) " +
                    "where GEN_KEY='SOCIAL_EVENT_TAG_ID'");
             c.executeUpdate();
             */                       
             c.prepareStatement("INSERT INTO ID_GEN " +
                    "(GEN_KEY, GEN_VALUE) " +
                    "VALUES ('SOCIAL_EVENT_TAG_ID', "+ ScaleFactors.tagCount + ")");
             c.executeUpdate();
            
            logger.fine("After updating Tag ID_GEN ID");
View Full Code Here

    public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
            for (int i = 0; i < userNames.length; i++) {
                PreparedStatement s = c.prepareStatement(STATEMENT);
                s.setString(1, userNames[i]);
                s.setInt(2, eventId);
                s.setString(3, comments[i]);
                s.setInt(4, ratings[i]);
                s.setDate(5, created_at);
View Full Code Here

             c.executeUpdate();
             */
           
             logger.fine("Updating Comments_Rating ID");
            
             c.prepareStatement("INSERT INTO ID_GEN " +
                    "(GEN_KEY, GEN_VALUE) " +
                    "VALUES ('COMMENTS_RATING_ID', "+ ScaleFactors.events +1 + ")");
             c.executeUpdate();
             
           
View Full Code Here

    public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
            for (String friend : friends) {
                PreparedStatement s = c.prepareStatement(STATEMENT);
                int alternate=0;
                if (alternate%2 == 0){
                    s.setInt(1, 0);
                }else{
                    s.setInt(1, 1);
View Full Code Here

            //for now, update to a ridiculous high number to avoid duplicate key
            //exceptions
           
           
             logger.fine("Updating Invitation ID");
             c.prepareStatement("INSERT INTO ID_GEN " +
                    "(GEN_KEY, GEN_VALUE) " +
                    "VALUES ('INVITATION_ID', "+ ScaleFactors.users +1 + ")");
             c.executeUpdate();
           
           
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.