Examples of ToJson


Examples of com.youtube.util.ToJSON

  public JSONArray queryReturnBrandParts(String brand) throws Exception {
   
    PreparedStatement query = null;
    Connection conn = null;
   
    ToJSON converter = new ToJSON();
    JSONArray json = new JSONArray();
   
    try {
      conn = oraclePcPartsConnection();
      query = conn.prepareStatement("select PC_PARTS_PK, PC_PARTS_TITLE, PC_PARTS_CODE, PC_PARTS_MAKER, PC_PARTS_AVAIL, PC_PARTS_DESC " +
                      "from PC_PARTS " +
                      "where UPPER(PC_PARTS_MAKER) = ? ");
     
      query.setString(1, brand.toUpperCase()); //protect against sql injection
      ResultSet rs = query.executeQuery();
     
      json = converter.toJSONArray(rs);
      query.close(); //close connection
    }
    catch(SQLException sqlError) {
      sqlError.printStackTrace();
      return json;
View Full Code Here

Examples of com.youtube.util.ToJSON

  public JSONArray queryReturnBrandItemNumber(String brand, int item_number) throws Exception {
   
    PreparedStatement query = null;
    Connection conn = null;
   
    ToJSON converter = new ToJSON();
    JSONArray json = new JSONArray();
   
    try {
      conn = oraclePcPartsConnection();
      query = conn.prepareStatement("select PC_PARTS_PK, PC_PARTS_TITLE, PC_PARTS_CODE, PC_PARTS_MAKER, PC_PARTS_AVAIL, PC_PARTS_DESC " +
                      "from PC_PARTS " +
                      "where UPPER(PC_PARTS_MAKER) = ? " +
                      "and PC_PARTS_CODE = ?");
     
      /*
       * protect against sql injection
       * when you have more than one ?, it will go in chronological
       * order.
       */
      query.setString(1, brand.toUpperCase()); //first ?
      query.setInt(2, item_number); //second ?
      ResultSet rs = query.executeQuery();
     
      json = converter.toJSONArray(rs);
      query.close(); //close connection
    }
    catch(SQLException sqlError) {
      sqlError.printStackTrace();
      return json;
View Full Code Here

Examples of com.youtube.util.ToJSON

  public JSONArray queryAllPcParts() throws Exception {
   
    PreparedStatement query = null;
    Connection conn = null;
   
    ToJSON converter = new ToJSON();
    JSONArray json = new JSONArray();
   
    try {
      conn = oraclePcPartsConnection();
      query = conn.prepareStatement("select PC_PARTS_PK, PC_PARTS_TITLE, PC_PARTS_CODE, PC_PARTS_MAKER, PC_PARTS_AVAIL, PC_PARTS_DESC " +
                      "from PC_PARTS");
     
      ResultSet rs = query.executeQuery();
     
      json = converter.toJSONArray(rs);
      query.close(); //close connection
    }
    catch(SQLException sqlError) {
      sqlError.printStackTrace();
      return json;
View Full Code Here

Examples of com.youtube.util.ToJSON

  public JSONArray queryCheckDbConnection() throws Exception {
   
    PreparedStatement query = null;
    Connection conn = null;
   
    ToJSON converter = new ToJSON();
    JSONArray json = new JSONArray();
   
    try {
      conn = oraclePcPartsConnection();
      query = conn.prepareStatement("select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') DATETIME " +
                      "from sys.dual");
     
      ResultSet rs = query.executeQuery();
     
      json = converter.toJSONArray(rs);
      query.close(); //close connection
    }
    catch(SQLException sqlError) {
      sqlError.printStackTrace();
      return json;
View Full Code Here

Examples of org.nutz.json.ToJson

        catch (BorningException e) {
            err = e;
        }
       
        Class<? extends Object> klass = mirror.getType();
        ToJson tj = klass.getAnnotation(ToJson.class);
        String myMethodName = Strings.sNull(null == tj ? null : tj.value(), "toJson");
        try {
            /*
             * toJson()
             */
            try {
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.