tybca slip81
import java.sql.*;
class slip81
{
Connection con;
Statement stm;
ResultSet rs;
slip81()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:emp");
stm=con.createStatement();
rs=stm.executeQuery("select * from empTable where ename like'p%'");
boolean b=false;
while(rs.next())
{
b=true;
System.out.print("\n"+rs.getString("eno")+"\t"+rs.getString("ename")+"\t"+rs.getString("dname")+"\t"+rs.getString("sal"));
}
if(b==false)
{
System.out.print("\n \n There is a no Record Found By the S letter...\n");
}
con.close();
stm.close();
}
catch(Exception e)
{
System.out.print(e.getMessage());
}
}
public static void main(String args[])
{
slip81 ob=new slip81();
}
}
class slip81
{
Connection con;
Statement stm;
ResultSet rs;
slip81()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:emp");
stm=con.createStatement();
rs=stm.executeQuery("select * from empTable where ename like'p%'");
boolean b=false;
while(rs.next())
{
b=true;
System.out.print("\n"+rs.getString("eno")+"\t"+rs.getString("ename")+"\t"+rs.getString("dname")+"\t"+rs.getString("sal"));
}
if(b==false)
{
System.out.print("\n \n There is a no Record Found By the S letter...\n");
}
con.close();
stm.close();
}
catch(Exception e)
{
System.out.print(e.getMessage());
}
}
public static void main(String args[])
{
slip81 ob=new slip81();
}
}
0 comments:
Post a Comment
Note: only a member of this blog may post a comment.