-
-
-
-
Truncate and Delete concept
Hi, Let us take a scenario such that I issue a delete on table emp and truncate on table emp1 which is exact replica (in terms of both structure and data) of emp table.Now , I issue a commit on both sessions. If I do a select * from emp and select * from emp1 now, which one should execute faster and why?
-
final method
having said a final method can be overloaded(default in d same class) plz explain me if there is anything missing in this code ? class Base { public final doSomething(Object o) { System.out.println("Object"); } } class Derived extends Base { public doSomething(Integer i) { System.out.println("Int"); } } public static void main(String[] args) { Base b = new Base(); ...
-
Multiple struts-config.xml files
In Struts, for what purpose we will be creating multiple struts-config.xml files? Can anyone help me out?
-
-
Exception
When super class method throws exception then subclass also throws the same Exception, which will compile?
-
What is the difference between inheritance and extends?
I have not mistaken extends for polymorphism or encapsulation or anything else.. my question is correct!!!
-
-
-
-
Database Driver
How to find which type driver used in Java or J2EE applications? Which type used commonly?
-
Transfer data in JSP
How to transfer data over multiple pages?
-
Implement and Extend Keywords
What is the implement, what is the extend keyword, what is the difference, give me answers in briefly ?
-
abstract body
can we declare abstract body ? Explain with simple example and the situation you would use ?
-
-
-
-
-
if there are more than one main method in a program, then which main method will be called.
what will be the output class A { public static void main(String args[]) { System.out.println("Hi friend"); } } class Test { public static void main(String args[]) { System.out.println(" How are you"); } }
-
Hashmap and Hashtable
which one is better and faster between hashmap and hashtable? Explain the situation where you would use them ?
-
Importance of java.lang.obj
What is the significance of java.lang.object class?
-
toString function
What is the default value for toString() in java? Explain me with an example?
-
Abstract - How do you make object
If all the methods in the Abstract class is defined, then it is a Abstract class? And can we make object out of it?
-
-
When does the String Literal pool gets cleared?
In one java class I have created this string String s1 = "abc";Now if I again use this same statement in a different java class, ie;String s2 = "abc";Will I get the same reference for "abc" in both the classes.
-
-
SQL NULLIF Function
What is the use of NULLIF function in SQL?
-
Multiple Interface
Why do we need interface concept instead of multiple inheritance? What is the drawback when we use the multiple inheritance?
-
Records Count
How to count number of records in a table without using COUNT function?
-
Retrieve Rows Without Using SELECT Clause
How can we retrieve some rows from the database without using select clause?
-
Create Index
How Create Index in Oracle? explain with example
-
JSP Comments
What are the ways to write comments in the JSP page? Give example.
-
Aggregation Key
What is the Aggregation Key?
-
Memory Allocation
What is the difference between below 2 statements? String s1=new String("abc");String s2="abc";How it will allocate in memory?
-
Avoid Data Duplication
If in a table we dont use primary key or any other unique key then how to avoid duplication of data?
-
Exception Handling in JSP
How will you handle the exception without sending to error page? How will you set a message detail to the exception object?
-
Number of Constraints
How to count the number of constraints on a given table?
-
Display Middle Record
How to display middle record in a given table?
-
Securing SQL Scripts
How to secure SQL scripts so that they cannot be seen by others but can only be executed.
-
LOCK Query
What is use of lock query in SQL Plus? Give its syntax and implementation?
-
Retrieve Odd and Even Rows
How to retrieve odd and even number of rows from a table?
-
Object Creation
In how many ways we can create an object? Explain with example.
-
Create table based on another table
How to create table emp1 based on emp, except comm column?
-
Overriding Methods
Suppose a Super Class method throws an exception and this method is Overriden in the subclass with no exception. Now if you create a super class reference that has a subclass object. This throws a compile time error, Why?
-
Synchronization in Java
When We should use Synchronization in Java and when we should not?
-
Correlated subquery
display the 5th lowest sal from emp table using Correlated subquery
-
Exception Handling
What is the output of the following program, When tested under JDK 5.0class ExceptionDemo{ public static void main(String[] args) { int a[] = new int[] {1,2,3,4,5}; try{ System.out.prinltln(a[6]); } catch(Exception e) { System.out.println("Catching Exception ..."); } catch(ArrayIndexOutofBoundsException ae) { System.out.println("Catching ArrayIndexOutOfBounds...
-
Output of Java Program
What is the output of the following program?class A{ public static void main(String[] s) { System.out.println(s[1] + s[2] + s[3]);}}java A 12345Options(i) 1(ii) 12(iii)1234(iv)234(v) Compilation Error
-
Delete contents in two tables at a time
How to delete contents in two tables at a time? When you delete contents in one table then other table contents should also be deleted.
-
Tune SQL Query
How can you tune the query?
-
Left Outer & Right Outer Join
What is the use of Left Outer & Right Outer Join, Using Equi Join with Union we can do the outer join then why we need to go for Outer Join
-
Retrieve data from two tables
How to retrieve data from two tables of different servers
-
Describe table without DESC Command
How to desc table data without using desc command
-
Data stored in Database
How data is stored in database?
-
SQL and PLSQL
What is the difference between SQL & PLSQL?
-
-
Which of the following values can be replaced in the place of 1 and 2 below Statement
Which of the following values can be replaced in the place of 1 and 2 below Statement stmt= con.createStatement(1,2);a) ResultSet. TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLYb) ResultSet. TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLEc) ResultSet. CONCUR_UPDATABLE, ResultSet. TYPE_SCROLL_SENSITIVEd) ResultSet.CONCUR_UPDATABLE, ResultSet. TYPE_FORWARD_ONLY
-
Convert string object to primitive Integer Type
How can i convert a string object to a primitive Integer type???????Thanks
-
Literal meaning of SQL
What is the literal meaning of SQL
-
Copy structure of a table
How can I copy the stucture of a table to a text file.
-
Unique Index and Simple Index
What is difference between unique index and simple index?is it possible, two rows can have the same unique index?
-
Dependency injection
What is dependency injection ?
-
-
-
How to catch an Error occurred in a class
Can we catch an Error occurred in a class by extending that class with Throwable Since, Exception and error is the sub class of throwable.If yes/no- why?
-
-
JDBC Type1 drivers
Can we use Type1 driver in web Application?If possible give me a simple example for all driver types?
-
-
-
Transient and Volatile.
What is the difference between Transient and Volatile. Does volatile variable is serialized and synchronised.
-
Why wait and notify method in Object class
Why wait and notify method in Object class, why these are not in Thread Class.
-
-
what are the necessary conditions to override the init() in servlets?
For overriding init()method any rules are there
-
Difference Between Collection and Legacy classes
What are the difference between Legacy classes and Collection other than Synchronized?
-
Run the Tomcat Server
Hi, Is it possible to run the 2 tomcat servers simultaneously with different ports.Some times it's working. some times its not running,Anybody can help me to solve this problem.Thxregards'Punitha.R
-
-
-
-
-
-
-
How to display nth highest record in a table for example ?
select salary from tablename order by desc limt 4;
-
-
Oracle : Table Level and Column Level constraints
We have two type of constraints - Table Level and Column Level. Which is better and why..?
-
-
-
-
-
-
why we need web container to Deploy the servlet or jsp ?
i.e Why we can not run the application like simple java program
-
-
-
-
-
-
-
-
-
-
How to truncate the table with cascade option?
I tried "truncate table cascadebut I got the error storage keyword is missing (says either drop storage or reuse storage) Can any one help me out.
-
-
-
-
Java Connection Pooling Questions
1.What is save point?2.Which among the four drivers is pure Java driver?3.What is Connection Pooling ?4.How differ servlet from its peer Technology?5.What are the parameters used in Connection pooling?6.What are the Normalization Rules? Define the Normalization?9.What are batch updates.10.How many JDBC drivers are there ?
-
What is the need of an abstract class?
If I write all of concrete methods in one class and all abstract methods in an interface and extend and implement both in third class assume that third class don't extend any other class?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
What is the difference b/w Iterator & ListIterator
Iterator : Enables you to cycle through a collection,obtaining or removing elementsListIterator :It extends Iterator allow bidirectional traversal of list & the modification of element
-
-
-
-
-
-
-
-
-
-
-
-
-
-
waht is the difference between Generic servlet and HTTPServlet
give me the answer
-
-
-
-
-
-
what is difference between array & arraylist?
arraylist is resizable where as using array it is not possible.
-
What is collection framework?what interfaces and classes support collection framework?
one can use different groups of objects in program using collection frame work.for more detail readcollection frame work from java.util pack.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
what is the difference b/w ORACLE and SQL
..........
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
What is the Difference between Design Pattern and Architecture? Can any one answer for this plz..
Design Pattern means how u r approaching the problem.Architecture means how the data is flowing in your application
-
Is it true the JAVA is realy a plateform indepandent?
no, because Java does not support multiple inheritance directly.
-
-
JVM is platform independent/dependent? why?
which one is faster in execution Array List or Array? why?
-
-
What is stored procedure?
A program running in the database that can take complex actions based on the inputs you send it. Using a stored procedure is faster than doing the same work on a client, because the program runs right inside the database server. Stored procedures are nomally written in PL/SQL or Java.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Command to show SQL commands from buffer
Which command displays the SQL command in the SQL buffer, and then executes it?
-
What is the servlet?
Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. For example, a servlet may be responsible for taking data in an HTML order-entry form and applying the business logic used to update a company's order database.
-
What are the differences between GET and POST service methods?
A GET request is a request to get a resource from the server. Choosing GET as the "method" will append all of the data to the URL and it will show up in the URL bar of your browser. The amount of information you can send back using a GET is restricted as URLs can only be 1024 characters. A POST request is a request to post (to send) form data to a resource on the server. A POST on the other hand will...
-
What JSP lifecycle methods can I override?
You cannot override the _jspService() method within a JSP page. You can however, override the jspInit() and jspDestroy() methods within a JSP page. jspInit() can be useful for allocating resources like database connections, network connections, and so forth for the JSP page. It is good programming practice to free any allocated resources within jspDestroy().The jspInit() and jspDestroy() methods are...
-
How can you use PreparedStatement?
This special type of statement is derived from the more general class, Statement. If you want to execute a Statement object many times, it will normally reduce execution time to use a PreparedStatement object instead. The advantage to this is that in most cases, this SQL statement will be sent to the DBMS right away, where it will be compiled. As a result, the PreparedStatement object contains not...
-
-
What modifiers may be used with a top-level class
A top-level class may be public, abstract, or final.
-
What is the return type of a program's main() method
A program's main() method has a void return type.
-
Does a class inherit the constructors of its superclass
A class does not inherit constructors from any of its superclasses.
-
what is a transient variable
A transient variable is a variable that may not be serialized.