Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Heba Mahmoud

Ranch Hand
+ Follow
since Apr 26, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Heba Mahmoud

i read data from files then insert it in table

i read files and load them in set then iterate in set and insert all data of it in the table
the problem occurs when the files have repeated data "that already have been inserted "

and i don't load all the files at same time ..... so the PK faild as sql exception...
really i want to solve problem from java side not from database side

so i want to prevent the sql exception from occuring and escaping the rest of the rows inserting when error in one row insert....

i solved it as check each string added as a primary key field in table to check that value isn't found before then insert it else don't do anything

so i did that as i don't know how to handle the exception when occur and make the program run successfully for the rest of rows that have no problem.....
Hello

i want to send an array values to be inserted in table field that should be a primary key for the table

so when i try to insert a repeated value in that colume , sql excepption will be thrown

i want to insert all values that not repeated and escape any reapeated values without throwing an exception that make the insertion operation fails for all records even they not repeated ....

please i need help in this issue


i took the exam yesterday and scored 85% .......

Thanks to my God
and also Thanks for all Coderanch memders who helping me .


and wishing success for all members who study for the scjp certificate.

and i need a suggestion about what is the next step after getting the certification of java 1.6.
10 years ago
i want an advice for the exam .... are the exam time are enough ? i know that it depends the one that take exam.
but in general ..... are the time is enough ?

and are we should solve all questions in their order ,or we may leave diffcult questions after finishing all exam questions? then retturn back to complete the unanswerd questions !!

and also what about drag and drop questions , can we change the answer after we choose in the drop boxes ?

and for me i will take the exam in the next week and i use k&b book for study material and i will revise the notes i wrote wihle solving mock exams . will this is enough for the exam perpration ?
i intend to enter the exam the next week

i want to know what about the exam time , is it enuogh more ?

and what about if i want not solve questions in order ?

can i press next question and then return back to the unanswerd questions at end of solving questions?

and what about the drag and drop questions , can i change the answer after selection?

for me i will only read the book of K & B and the notes i wrote while i solve mocks exam.
are that will enough or should do more ?
10 years ago
whizlabs exams

http://www.whizlabs.com/scjp/scjp.html

also if you find any mock exams please send us its link.
Which collection would be the best one to use, if you were working with a Student Information management web application that needs to maintain and search students, stored as instances of a class 'Student'.
You should be able to perform the following:
i) identify a Student by its unique alphanumeric identification number.
ii) Print out the Student in order of their unique identification numbers
A) List
B) ArrayList
C) HashMap
D) TreeMap
E) HashSet
F) Arrays
G) LinkedList
H) Sets


Answer : D (TreeMap)
Explanation :
Option D is correct. Both HashMap and TreeMap enable storing a 'key' and a 'value' combination, where the values and keys can be objects, and the objects are searchable on their keys. However, only TreeMap maintains the natural order of the keys.

source are : http://www.cafe4java.com/mockexams/scjp/mock3/a1.php

could you please show me why the true answer is D? even the question asks for a collection and map is not a collection.
Congratualtion .....

but kindly could you tell us what you do for exam prepration ?
10 years ago
Congrulation ..... really your comments are so usefull and also your syudy notes
10 years ago

Ankit Garg said ...
x is not a constant, so the compiler cannot detect its value at compile time so doesn't know that the if condition is true and the println statement is not reachable.



i understand from that if we make the boolean x = true ; as a final value then we should have a complair error as x in that case is a constant .... but it complies and runs fine ......



1-i think there is a difference between ++x and x++... how the value become the same in iteration ??

2- what about that case of unreachable code ,.. i think that it should the complair fails .. but it doesn't.


3- when say transient int value =8; after deserialize it becomes 0 as i understand , may be i am wrong
so when it is final , what do you think it will be ?
1-what is the difference between x++ and x+=1 in the for loop iteration?such as saying
for(int x=0; x< 3 ;x+=1)
for(int x=0; x< 3 ;++x)
for(int x=0; x< 3 ;x++) how the 3 cases output the same value for x for each iteration.

2-what make the code unreachable in the try/catch/finally/code after finally code ??

3- as i understand when we try to deserialize transient variable , it gets its default value of its datatype , ok what about if that transient variable was also final ?? and if this information are wrong ,would anyone can confrim me?

this questions has no source ,as this is from my mind ...