chakraborthy


{ City }
< Country > india
* Profession *
User No # 29240
Total Questions Posted # 0
Total Answers Posted # 11

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 48
Users Marked my Answers as Wrong # 29
Questions / { chakraborthy }
Questions Answers Category Views Company eMail




Answers / { chakraborthy }

Question { Wipro, 8094 }

How to execute bulk number of queries at once?


Answer

we can update multiple statements using batch as follows

statemenent st = getconnection().getStatement();
st.addBatch(sql stat1);
st.addBatch(sql stat2) ;

....

st.executeBatch();

Is This Answer Correct ?    7 Yes 0 No

Question { 11066 }

What is HashTable?


Answer

hash table is synchronized ,so in performance perspective
it is not good when compared to hashmap

Is This Answer Correct ?    11 Yes 2 No


Question { IBM, 6150 }

How can a java objects be stored in database?


Answer

java objects which implements serializable interface can be
stored using setBlob method after storing object to a file

Is This Answer Correct ?    3 Yes 1 No

Question { 2987 }

How warnings are retrieved in JDBC?


Answer

while using jdbc, warnings can occur at any time
while getting connection
while creating statement
while getting resultset, at each , we can get using
getWarnings() method.

Is This Answer Correct ?    0 Yes 0 No

Question { 3477 }

How to get a whole row of data at once?


Answer

at present we dont have any methods for retrieving whole
row at a time in jdbc

Is This Answer Correct ?    1 Yes 1 No

Question { IBM, 7469 }

Without using of Class.forName(? ?), how do you connect to
db?


Answer

by using datasource object, generally datasource is
confiured at app server specifying jndi name , data source
name, driver name, user name, and password.

by getting datasource object using jndi lookup, we can get
connection.

Is This Answer Correct ?    3 Yes 1 No

Question { 6685 }

What is Statement and PreparedStatement? whatz the
difference?


Answer

As harish, said prepared statement is pre-complied so it
will be very fast when compared to normal statement.when we
execute same query again and again for different set of
input data.

code snippet for this is :--


for normal statement :

Statement st = conn.createStatement();

for prepared statement :

PreparedStatement prSt = conn.prepareStatement
("query") ;

// set values for input paramenters and execute as usual.

Is This Answer Correct ?    2 Yes 2 No

Question { Infosys, 5465 }

What is a PreparedStatement?


Answer

If same query is executed multiple times over DB for
different values, we go for preparedStatement

PreparedStatement ps = con.prepareStatement(
"UPDATE TABLE_NAME SET COLUMN = ? WHERE COF_VALUE
LIKE ?");

Is This Answer Correct ?    3 Yes 0 No

Question { 18555 }

why interfaces are faster than abstract classes?


Answer

one more thing about interface is, we dont have any
implementations,so no burden of this, hence it is good in
performance

Is This Answer Correct ?    5 Yes 21 No

Question { ProdEx Technologies, 7677 }

How to sort a vector elements that contains the user define
class object? (Note: If Suppose consider, A Student class
contain two data members. They are String studentName and
int rollNo. I am creating Four objects for this class, each
object contains students details like name and roll no. Now
i am storing that objects in vector and if i retiving the
elements from the vector means then it should be display in
sorting order)


Answer

other way to achieve this is implementing comparator
interface and implement compare(object) method.

Is This Answer Correct ?    7 Yes 1 No

Question { 6386 }

explain about jre and jvm


Answer

JRE includes (JVM ) java virtual machine and some other
library files. That runs a java application

Is This Answer Correct ?    6 Yes 0 No