Derby JDBC client file
The Apache Derby JDBC driver is included inside the derbyclient.jar file that comes with the BIN or lib distribution of Derby.
sharing some tech problems and soln
The Apache Derby JDBC driver is included inside the derbyclient.jar file that comes with the BIN or lib distribution of Derby.
Posted by Sajjad at 9:54 pm 1 comments
import java.util.ArrayList;
public class Main {
/**
* @param args
*/
public static ArrayList
ArrayList
for (String w : words) sentence.add(w);
for (String w : more) sentence.add(w);
return sentence;
}
public static void main(String[] args) {
String[] northAmerica=new String[5];
northAmerica[0]="USA";
northAmerica[2]="CANADA";
northAmerica[1]="Mexico";
northAmerica[3]="Panama";
northAmerica[4]="Haiti" ;
String[] southAmerica=new String[5];
southAmerica[0]="Brazil";
southAmerica[1]="Argentina";
southAmerica[2]="Colombia";
southAmerica[3]="Uruguay";
southAmerica[4]="Venezuela";
ArrayList
americanContr=merge(northAmerica, southAmerica);
System.out.println(americanContr);
}
}
Posted by Sajjad at 1:55 pm 0 comments
Labels: Java
import java.util.HashMap;
/**
*
*/
/**
* @author Sajjad
*
*/
class Student
{
private int id;
private String name;
private String std;
public int getId() {
return id;
}
public Student(int id, String name, String std) {
this.id = id;
this.name = name;
this.std = std;
}
@Override
public String toString() {
return "Student [id=" + id + ", name=" + name + ", std=" + std + "]";
}
}
public class hashTable {
/**
* @param args
*/
public static HashMap
HashMap
for (Student s : students) map.put(s.getId(), s);
return map;
}
public static void main(String[] args) {
Student[] students = new Student[5];
students[0]=new Student(1, "abdulla", "KG1");
students[1]=new Student(2, "Mohd", "KG2");
students[2]=new Student(3, "Harry", "2");
students[3]=new Student(4, "Saud", "KG1");
students[4]=new Student(5, "John", "KG2");
// TODO Auto-generated method stub
// for (Student s : students)
//{
// System.out.println(s);
//}
HashMap
myMap=buildMap(students);
System.out.println(myMap);
}
}
Posted by Sajjad at 1:39 pm 0 comments
FacesContext context = FacesContext.getCurrentInstance();
HttpSession session =
(HttpSession)context.getExternalContext().getSession(true);
session.setAttribute("username", user);
session.setAttribute("password", pass);
Posted by Sajjad at 5:17 am 0 comments
Posted by Sajjad at 2:04 am 0 comments
Labels: JavaEE, Jdeveloper, JSF