sumi essakiappan

Greenhorn
+ Follow
since Nov 17, 2004
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 sumi essakiappan

Actually the java develepment team called Green project consisting of james gosling,patrick naughton,chris wrath,ed frank and mike sheridan used to hav tea at a coffee shop called java.dats how the name came and the symbol too....
12 years ago

hi all,

in the program thge values of JLabel ll and txt are getting lost in the
getcon() function ...i think some problem with acess control...
kindly guide.

import java.sql.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class deldr extends JFrame implements ActionListener
{
ResultSet rs;
Connection con;
Statement s1;
public JLabel ll;
public String st;
public JTextField txt;
JPanel pp;
public deldr()
{
System.out.println("hello");
JLabel ll= new JLabel("enter the doctor name");
JTextField txt=new JTextField(30);
//System.out.println(txt);
txt.setActionCommand("txt");
txt.addActionListener(this);
JPanel pp=new JPanel();
pp.add(ll);
pp.add(txt);
getContentPane().add(pp);
setSize(600,700);
show();
//System.out.println(ll);
}

public void getcon()
{
System.out.println(ll);
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc dbc gcora","m98a28","m98a28");
s1=con.createStatement();
System.out.println(ll);
System.out.println("hello");
}catch(Exception e){}
}

public void del()
{
getcon();
//String ll=txt.getText().trim();

String query="delete from doctors where name="+"'"+ll+"'";
System.out.println("hello1");
try
{
//s1.executeUpdate(query);
//con.commit();
}catch(Exception e){}
}
public void actionPerformed(ActionEvent e)
{
String str;
str=e.getActionCommand();
if(str.equals("txt"))
{
del();
}
}
public static void main(String args[])
{
deldr d= new deldr();
}
}
23 years ago