How to connect the database to customize anything in JDBC? – tu telugu

 

How to connect the database if you want to increase the font size holding crease the font size here in the toolbar right-click properties you can wait for the console you can make it 24 okay that’s it there how do carry the database co-CEO in any connector system/return right that’s a system / Ratan connected it select a store from EMP three rows are there here no simply can go add some insert the records insert into EMP values come on you do the practical slowly insert into EMV values I want to insert some records so triple one button I said rappin within the single quotes the last one is the salary some ten thousand I inserted so simply can go to commit operation here how to select the data app select star from DMV right that’s it how many cars are there now how many cars are they to create the screen CL spaces here clear screen select to start from EMP how many cars are there one Ricarda, okay so do the operation slowly so I won’t insert the triple – I want to insert the triple three. 

So return is already some drug data’s it this is twenty thousand here thirty thousand so increment assault these are all set of operations right the set of operations is called transaction so if everything is going good then simply can go with the connection touch operation air come here ten seconds not commit a session dot order Pindell now so simply can write the operations are successful right whatever catch block here if anything is failed control goes to catch block in the catch block what I have to do connection data rollback I said right steps what are the points resource declaration means these are the resource declaration second point try block do the operation use the commit catch block use the rollback operations or a catch block use rollback operation the last one is a finally block whatever finally block here release the release of the resource. 

The resources see here rollback is also throwing an exception here say job say everything is exceptional code me how to take care about the exceptions right now take care of the exception simply here can go with the throws that are it otherwise once again how to take the try-catch blocks here try-catch blocks whatever the catch block you want you can do that operation whatever finally block here resource releasing I said in the previous videos before releasing the resources we have check resources available or not available if connection not equal to the null connection not equal to null then only you have to close the connection dot close because there may be a chance of connection is not created maybe a chance of connection is already released right so before releasing the resources we have to check resource is available or not say the second one is a statement term Accord statement, not equal null then simply connect the statement. 

Data statement not close right that’s always actually this this close method is also handling exception actually but here all day used to throw skew right the reason it is not showing any messages here it’s not showing any operations that’s all if the points are clear right before at least in the resources just to how to check resources available are not available I think this example is clear right that’s all guys so try block do the operation catch block rollback it finally locally the resources right good intention I am doing W equal to l1 here W equals means this operation is failed right employ an equal to diplomat means the success actually double equal table 1 is the operation is failed or not operation is fail means will get two checks option yes kill exception scarry extra control goes to ensure block control goes to catch block in the cache block we are using which operation rollback operation right catch block we’re using rollback operation simply can write the operations are failing. 

So no catch block is enrolled back coverage means the transaction is rolled back up to the starting point or not operations are not committed and simply can run this code we will get the message we get exception way exception here so the connection does not roll back first of all connection creation process first of all II can tell me the connection is created and not created here not created because you have to load the driver right I say I hope you know we gave driver class database vendor given a driver class name so we have to build but the jarful a notch you have to build up at the jar file so to build path the jar file or I click on the project turmeric click on project build path configure build path X libraries I had external jobs you can go to jar file where is jar file location was installed Oracle the default location is Oracle XE a per Oracle product 11-point 2.0 server you can go to JDBC so labor or jv6 jar file you how to select click on open click on ok ok simply. 

Now run this code actually so run this code simply you will get the mistress connection created successfully or not connection created successfully then connect operations are failed its operations are failed because this employee W equal to triple when this is VIN valued right then go to the database select a star from EMP any records are braided here no update are not know right good so you can make it equal to Table one this is valid right this is valid means all operations are okay if all operating sort of means transaction is committed are not transact nice committed operations or success right if operations are success if operations are success then what happened here triple T is inserted triple tree is inserted thousand rupees added and trip loan is deleted are not tipline will be deleted simply if you only can check it run the code to run the code here directly run but nice technically done button run test DB 1 otherwise here right click run as java application this is also valid click on OK now operators are success write operations are success operates our success means triple 2 is added apple trees added triple one is deleted right go to the database once selected start from EMP so triple one is deleted and triple 2 is added table 3 is added then it is thousand rupees extra added or not it means transaction success it that’s all guys this is the way how to work with the transaction management so Adam a transaction here set of operations this set of operations are okay set of operations are working and then go to success mode right that’s all this is the example one regarding your transaction management example one regarding even transaction management you need also getting to this exam they need out sure if you have any doubts regarding this examples. 

And done you can mail to the mail ID job I returned at gmail.com is there right just you can mail that milady me just I will check it and I will forward the points right that’s it exam one is the clear right set of operations this is cover this is a way how to do the transaction management.

You have to wait 15 seconds.

Generating Code…

Get Code

Leave a Comment