abhi vazhakalil

Greenhorn
+ Follow
since Mar 24, 2010
Merit badge: grant badges
For More
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 abhi vazhakalil

Jan Cumps wrote:Welcome to JavaRanch, Abhi.




Thanks Jan

sahar sa wrote:Dear friends,
I have a problem with making and closing the connection to my data base.
let me explain, I closed my CONNECTION and PSTMT after insert query but when I run this code after the first round I get the below error :
code:
trigger code:



insert code:


error:


so according to this error I should remove closing conn and pstmt but in all the examples I found they closed them.

Can some one tell me what will happen if i do not close my CONNECTION and PSTMT after insert, delete or select?

thnx,
Sahar.




I executed this above program successfully without any exception. As whenever you are calling the insert method, you are creating a fresh connection object. So if you close connection, it does'nt matter.
Hey, this is a common issue which most of the beginners come across. What you need to do is just download the jar myql jar file and add this file under your libraries. This issue will be solved.