Top X Jdbc Interview Questions Answers For Coffee Programmer
Top X Jdbc Interview Questions Answers For Coffee Programmer - Hallo sahabat BEST LEARNING JAVA, Pada Artikel yang anda baca kali ini dengan judul Top X Jdbc Interview Questions Answers For Coffee Programmer, kami telah mempersiapkan artikel ini dengan baik untuk anda baca dan ambil informasi didalamnya. mudah-mudahan isi postingan
Artikel core java,
Artikel core java interview question,
Artikel JDBC, yang kami tulis ini dapat anda pahami. baiklah, selamat membaca.
Judul : Top X Jdbc Interview Questions Answers For Coffee Programmer
link : Top X Jdbc Interview Questions Answers For Coffee Programmer
>
CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");
Further Learning
JSP, Servlets together with JDBC for Beginners: Build a Database App
Complete JDBC Programming Part 1 together with 2
20 software pattern together with pattern pattern inquiry for Java programmer
Judul : Top X Jdbc Interview Questions Answers For Coffee Programmer
link : Top X Jdbc Interview Questions Answers For Coffee Programmer
Top X Jdbc Interview Questions Answers For Coffee Programmer
JDBC Interview Question together with Answer
JDBC Questions are integral business office of whatever Java interview, I direct maintain non seen whatever Java Interview which is completed without asking unmarried JDBC Interview question, at that topographic point are ever at to the lowest degree i or ii inquiry from JDBC API. Some of the pop questions similar Why you lot should purpose PreparedStatement inward Java, Difference betwixt PreparedStatement and CallableStatement in Java together with few questions is related to improving performance of JDBC layer yesteryear applying about JDBC performance tips. In this article I direct maintain summarized few often asked questions inward JDBC, they ranges from slow to hard together with beginner to advanced. Questions similar distributed transaction management together with 2 stage commit is tough to reply until you lot direct maintain existent sense but generally asked inward diverse J2EE interviews. This is non an extensive listing of JDBC inquiry answers but practicing or revising this inquiry earlier going to whatever Java interview for certain helps.
10 JDBC Interview inquiry reply inward Java
Here is my listing of often asked JDBC inquiry inward Java, I direct maintain tried to render reply to most of question. If you lot direct maintain whatever interesting JDBC inquiry which you lot direct maintain faced together with non inward this listing together with thence delight percentage amongst us.
>
Question 1: What is JDBC?
Answer : One of the source JDBC interview inquiry inward most of interviews. JDBC is coffee database connectivity equally elevate implies it’s a coffee API for communicating to relational database, API has coffee classes together with interfaces using that developer tin easily interact amongst database. For this nosotros demand database specific JDBC drivers. Some fourth dimension this likewise termination inward followup questions similar Difference betwixt type 2 together with type four JDBC drivers. See the link for answer.
Question 2: What are the principal steps inward coffee to brand JDBC connectivity?
Answer : Another beginner score JDBC Interview question, generally asked on telephonic interviews. Here are principal steps to connect to database.
· Load the Driver: First measurement is to charge the database specific driver which communicates amongst database.
· Make Connection: Next measurement is acquire connexion from the database using connexion object, which is used to mail SQL contestation likewise together with acquire termination dorsum from the database.
· Get Statement object: From connexion object nosotros tin acquire contestation object which is used to query the database
· Execute the Query:Using contestation object nosotros execute the SQL or database query together with acquire termination laid from the query.
· Close the connection:After getting resultset together with all required functioning performed the concluding measurement should move closing the database connection.
For consummate code illustration you lot tin likewise refere Java plan to connect to Oracle database
Question 3: What is the hateful of “dirty read“ inward database?
Answer : This sort of JDBC interview inquiry is asked on 2 to four years sense Java programmer, they are expected to familiar amongst database transaction together with isolation score etc. As the elevate it self bring the important of muddied read “read the value which may or may non move correct”. inward database when i transaction is executing together with changing about plain value same fourth dimension about some other transaction comes together with read the modify plain value earlier source transaction commit or rollback the value ,which drive invalid value for that field, this scenario is known equally dirty read.
Question 4: What is 2 stage commit?
Answer : This is i of the most pop JDBC Interview inquiry together with asked at advanced level, generally to senior Java developers on J2EE interviews. Two stage commit is used inward distributed surround where multiple physical care for choose business office inward distributed transaction process. In unproblematic discussion nosotros tin empathize similar if whatever transaction is executing together with it volition trial multiple database together with thence ii stage commit volition move used to brand all database synchronized amongst each other.
In ii stage commit, commit or rollback is done yesteryear ii phases:
1. Commit asking phase: inward this stage principal physical care for or coordinator physical care for choose vote of all other physical care for that they are consummate their physical care for successfully together with create to commit if all the votes are “yes” together with thence they decease ahead for adjacent phase. And if “No “then rollback is performed.
2. Commit phase: according to vote if all the votes are yes together with thence commit is done.
Similarly when whatever transaction changes multiple database subsequently execution of transaction it volition number pre commit command on each database together with all database mail acknowledgement together with according to acknowledgement if all are positive transaction volition number the commit ascendance otherwise rollback is done .
Question 5: What are dissimilar types of Statement?
Answer : This is about other classical JDBC interview question. Variants are Difference betwixt Statement, PreparedStatemetn together with CallableStatement inward Java. Statement object is used to mail SQL query to database together with acquire termination from database, together with nosotros acquire contestation object from connexion object.
There are 3 types of statement:
1. Statement: it’s a unremarkably used for getting information from database useful when nosotros are using static SQL contestation at runtime. it volition non direct maintain whatever parameter.
Statement stmt = conn.createStatement( );
ResultSet rs = stmt.executeQuery();
2. PreparedStatement: when nosotros are using same SQL contestation multiple fourth dimension its is useful together with it volition direct maintain parameter at runtime.
String SQL = "Update stock SET limit = ? WHERE stockType = ?";
PreparedStatement pstmt = conn.prepareStatement(SQL);
ResultSet rs = pstmt.executeQuery();
To larn to a greater extent than nigh PreparedStatement, see What is PreparedStatement inward Java together with Benefits
3. Callable Statement: when nosotros desire to access stored procedures together with thence callable contestation are useful together with they likewise direct maintain runtime parameter. It is called similar this
ResultSet rs = cs.executeQuery();
Question 6: How cursor industrial plant inward scrollable termination set?
Answer : Another tough JDBC Interview question, non many Java programmer knows nigh using Cursor inward Java.
in JDBC 2.0 API novel characteristic is added to motion cursor inward resultset backward forrard together with likewise inward a item row .
There are 3 constant define inward termination laid yesteryear which nosotros tin motion cursor.
· TYPE_FORWARD_ONLY: creates a nonscrollable termination set, that is, i inward which the cursor moves alone forward
· TYPE_SCROLL_INSENSITIVE : a scrollable termination laid does non reflects changes that are made to it piece it is open
· TYPE_SCROLL_SENSITIVE: a scrollable termination set reflects changes that are made to it piece it is open
Question 7: What is connexion pooling?
Answer : This is likewise i of the most pop inquiry asked during JDBC Interviews. Connection pooling is the machinery yesteryear which nosotros reuse the recourse similar connexion objects which are needed to brand connexion amongst database .In this machinery customer are non required every fourth dimension brand novel connexion together with and thence interact amongst database instead of that connexion objects are stored inward connexion puddle together with customer volition acquire it from there. thence it’s a best means to percentage a server resources amid the customer together with heighten the application performance. If you lot purpose Spring framework, together with thence you lot tin likewise refer How to setup JDBC Connection Pool using Spring inward Java
Question 8: What produce you lot hateful yesteryear mutual depression temperature backup, hot backup?
Answer : This inquiry is non straight related to JDBC but about fourth dimension asked during JDBC interviews. Cold dorsum is the backup techniques inward which backup of files are taken earlier the database restarted. In hot backup backup of files together with tabular array is taken at the same fourth dimension when database is running. H5N1 warm is a recovery technique where all the tables are locked together with users cannot access at the fourth dimension of backing upwards data.
Question 9: What are the locking organization inward JDBC
Answer : One to a greater extent than tough JDBC inquiry to empathize together with prepare. There are 2 types of locking inward JDBC yesteryear which nosotros tin direct maintain multiple user number using the record. if ii user are reading the same tape together with thence at that topographic point is no number but what if users are updating the tape , inward this instance changes done yesteryear source user is gone yesteryear minute user if he likewise update the same tape .so nosotros demand about type of locking thence no lost update.
Optimistic Locking: optimistic locking lock the tape alone when update choose place. Optimistic locking does non purpose exclusive locks when reading
Pessimistic locking: inward this tape are locked equally it selects the row to update
Question 10: Does the JDBC-ODBC Bridge back upwards multiple concurrent opened upwards statements per connection?
Answer: No, nosotros tin opened upwards alone i contestation object when using JDBC-ODBC Bridge.
That’s all on this listing of 10 JDBC Interview inquiry amongst answer. As I said JDBC API together with at that topographic point concepts are integral business office of whatever Java interview together with at that topographic point is ever atleast i inquiry from JDBC. Since most application uses datbase inward backend, JDBC becomes critical for whatever Java developer.
Further Learning
JSP, Servlets together with JDBC for Beginners: Build a Database App
Complete JDBC Programming Part 1 together with 2
20 software pattern together with pattern pattern inquiry for Java programmer
Demikianlah Artikel Top X Jdbc Interview Questions Answers For Coffee Programmer
Sekianlah artikel Top X Jdbc Interview Questions Answers For Coffee Programmer kali ini, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sampai jumpa di postingan artikel lainnya.
Anda sekarang membaca artikel Top X Jdbc Interview Questions Answers For Coffee Programmer dengan alamat link https://bestlearningjava.blogspot.com/2019/09/top-x-jdbc-interview-questions-answers.html
Belum ada Komentar untuk "Top X Jdbc Interview Questions Answers For Coffee Programmer"
Posting Komentar