title: Memcached in java
body: <p>I am having web page which takes too much of time to load as its having a huge amount of data in mysql database.</p>
  
  <p>I am using a java class file for connecting mysql database and executes a query.</p>
  
  <p>I need have to add memcache .I have installed memcache .</p>
  
  <p>And i had a code as follows </p>
  
  <pre><code>String[][] test=null;
  MemcachedClient c=new MemcachedClient(new InetSocketAddress("localhost",11211));
  if (!"mykey1".equals("")&amp;&amp;"mykey1"!=null) {
      System.out.print(test[0][0]);
  } else {
      System.out.print("Else");
      test=new Test(conn).getTestInfo(1,50);
      c.set(key, 3600, url);
      System.out.println("get"+c.get(key));
      Object myObject=c.get(key);
  }
  </code></pre>
  
  <p>Where Test is another java class with db connection ...
  If i run the above code it just executes else part and it goes on running the class file the build does not get stopped</p>
  
  <p>Am really very new to memcache ,pls help me in doing memcache in java ......</p>