8 Posted Topics
Hello friends [CODE]String sql = "SELECT * FROM work.cs_book WHERE bookname = ? AND author = ? AND category = ?";[/CODE] I have writtern above query and where i can search for a book based on bookname author and category. I am using preparedStatements to execute query. However something is … | |
Hello friends, I am working on online book store project using Java and Servlets. I am struck at desgining part. The scenario is simple anyone can come and search books but only registered customers can buy them. 1. Is it good to create multiple database connections or single connection? If … | |
[CODE] import java.io.*; import java.io.IOException; public class ReadWriteFile{ static File f1 = new File("C:\\source.txt"); static File f2 = new File("C:\\dest.txt"); public String readFile() throws IOException { String msg = ""; FileReader fr = new FileReader(f1); BufferedReader br = new BufferedReader(fr); msg = br.readLine(); System.out.println(msg); fr.close(); return msg; } public void … | |
hello people, I am checking the string pool and its basic operation i.e. how it works [CODE] public class Test { public static void main(String[] args) { String s1 = new String("abc"); String s2 = "abc"; String s3 = s2; System.out.println("Hash Table: "); System.out.println(s1.hashCode()+ " "+ s2.hashCode()+" "+s3.hashCode()); System.out.println("== Check: … | |
Hello friends, I have a Customer class (Parent class) and Member class (child class which extends Customer class). the coding is like this [CODE] public class Customer { String name; } public class Member extends Customer { int memberID; } public class Tranasaction { public void printTransaction(Customer customer) { if(customer.memberID … | |
Hello friends, I am new to java and enum use. Actually I need to give only 3 options to customer for Payment Type. So i thought of using enum and making the limited members of Payment [CODE]enum PaymentType { CHEQUE, CREDITCARD, CASH }; public void Customer(String name, PaymentType paymentType) { … | |
hello people... simple doubt [CODE] class test { public static long testApp(long number) { return number; } }[/CODE] when i pass "45638" it returns perfectly but when i pass "23837472"; it's returning not in the range. what's the issue as long has very big value/range.. and how do i pass … |
The End.