Google Analytics

Showing posts with label JAVA. Show all posts
Showing posts with label JAVA. Show all posts

Sunday, November 20, 2016

Java for loop escape one loop

To avoid an iteration use CONTINUE key word. Presentation

for (Vehicle printVehicle : getParkedVehicles()) {
if("VAN".equals(printVehicle.getVehicleType().toUpperCase())){
vanCount++;
if(vanCount == 2){
vanCount = 0;
continue;//SKip the iteration related to additional Van record
}
}
}

Tuesday, October 21, 2014

WebLogic 10.3.5.0 won't stop or start propperly after Jdev upgrade


http://www.oracle.com/technetwork/developer-tools/jdev/11gr2update3-1851251.html#11.1.2.3.0ShermanUpdate3-ReleaseNotesREPOSITORY-Deployment

Download and install WLS 10.3.6. Download and install Application Developer 11.1.1.6. For more information see the Oracle Fusion Middleware Installation Planning Guide.
Run the Fusion Middleware Configuration wizard and create a new domain, or extend an existing domain, using the JRF + EM + OWSM domain template.
Download the 11.1.2.3.0 Opatch bundles and use the opatch tool to apply the patches (see Install the Patch below).
Shutdown the target domain servers.
Run the WLST "upgradeADF" command in offline mode (see Run the Commands below).
Restart the servers.

Please refer blow link for more info:
https://community.oracle.com/message/10955874#10955874



Wednesday, October 15, 2014

Oracle ADF QRSLT Error

ADF QRSLT Error

Refer blow links:
https://community.oracle.com/thread/2300657?tstart=0


public class ProfileVVOImpl extends CCBSViewObjectImpl {
    /**
     * This is the default constructor (do not remove).
     */
    public ProfileVVOImpl() {
        super.setNestedSelectForFullSql(false);
    }


Note:
Seems this is a bug in 12c. Work aroun in below link for 11G R3.
But fixed in  12.1.3 .

>https://java.net/jira/browse/ADFEMG-213

>http://jdeveloperfaq.blogspot.com/2010/02/faq-13-how-to-avoid-common-pitfalls.html



Thursday, September 25, 2014

Java New Loop

Observed the code from:
http://alvinalexander.com/java/java-string-array-reference-java-5-for-loop-syntax

public class JavaStringArrayTests2
{
  private String[] toppings = {"Cheese", "Pepperoni", "Black Olives"};
  // our constructor; print out the String array here
  public JavaStringArrayTests2()
  {
    <b>for (String s: toppings)
    {
      System.out.println(s);
    }</b>
  }
  // main kicks everything off.
  // create a new instance of our class here.
  public static void main(String[] args)
  {
    new JavaStringArrayTests2();
  }
}

JAVA String Splitting for given length

Observed the code from:
http://stackoverflow.com/questions/12295711/split-a-string-at-every-nth-position

public String[] splitStringEvery(String s, int interval) {
    int arrayLength = (int) Math.ceil(((s.length() / (double)interval)));
    String[] result = new String[arrayLength];

    int j = 0;
    int lastIndex = result.length - 1;
    for (int i = 0; i < lastIndex; i++) {
        result[i] = s.substring(j, j + interval);
        j += interval;
    } //Add the last bit
    result[lastIndex] = s.substring(j);

    return result;
}

Thursday, July 31, 2014

JAVA Could not find or load main class


 If below type error occur:

Java and cmd "Could not find or load main class"
-bash: ./xxx.sh: /bin/sh^M: bad interpreter: No such file or direct


>>Format the xxx.sh from unix.
>>: set fileformat=unix

More info:
http://lanvu.wordpress.com/2012/01/06/linux-shell-scripting-bad-interpreter-no-such-file-or-directory/

Tuesday, May 27, 2014

ADF Out of Memmory error in Windows 7

Jdeveloper Version: 11.1.1.3
Unchecked to avoid exception.