Saturday, 20 July 2013 0 comments

XML Slide and StyleSheet


XML Slide and StyleSheet

Here is the XML with StyleSheet Slide of Miss Aisha. 


Click Here to Download
0 comments

XML Slide and Schema


XML Slide and Schema

Here is the XML Schema of Miss Aisha. 


Click Here to Download
0 comments

XML Slide


XML Slide

Here is the XML of Miss Aisha. 


Click Here to Download
Monday, 15 July 2013 0 comments

XML DTD and Schema

XML

Here is the XML file of Miss Aisha Khan

Note : This is Program not Presentation or PDF Kindly Understand the code and Work. Paste in NOTEPAD and save it with .xml extension.

XML

 <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE>
<student>
<id>1</id>
<name>Owais</name>
<enroll_no>1207G1</enroll_no>
</student>

DTD XML

 <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE student [
<!ELEMENT student  (id,name,enroll_no)>
<!ELEMENT id  (#PCDATA)>
<!ELEMENT name  (#PCDATA)>
<!ELEMENT enroll_no  (#PCDATA)>
]>
<student>
<id>1</id>
<name>Owais</name>
<enroll_no>1207G1</enroll_no>
</student>

Schema

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema> <!--xmlns means XML NameSpace-->
<xs:element name="price">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="currency" type="xs:string" use="required"></xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
Friday, 5 July 2013 0 comments

Java Database Connection With SQL

Java Database Connection

Here is the Java Programming Program of Database Connection with SQL of Miss Aisha Khan.

Note : This is Program not Presentation or PDF Kindly Understand the code and Work. Can Ask Anytime for help.


JavaForm: Make 2 textboxes and 3 button for Insert,Update and Delete

Insert Button
 
 try{
      
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection conn=DriverManager.getConnection("jdbc:odbc:s1", "sa", "aptech");
       Statement s = conn.createStatement();
        int id=Integer.parseInt(Id.getText());
        String name = Name.getText();
        s.execute("insert into student values('"+id+"','"+name+"')");
        System.out.println("Recond Inserted");
    }
    catch(Exception e){
        System.out.println(e);
    }


Update Button:
 
try{
       
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection conn=DriverManager.getConnection("jdbc:odbc:s1", "sa", "aptech");
       Statement s = conn.createStatement();
        int id=Integer.parseInt(Id.getText());
        String name = Name.getText();
        s.execute("update student set std_name='"+name+"' where std_id='"+id+"'");
        System.out.println("Row Updated");
    }
    catch(Exception e){
        System.out.println(e);
    }

 
Delete Button:

try{
      
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection conn=DriverManager.getConnection("jdbc:odbc:s1", "sa", "aptech");
       Statement s = conn.createStatement();
        int id=Integer.parseInt(Id.getText());
        String name = Name.getText();
        s.execute("delete from student where std_id='"+id+"'");
        System.out.println("Row Deleted");
    }
    catch(Exception e){
        System.out.println(e);
    }
Thursday, 4 July 2013 0 comments

Java Synchronized Thread

Java Synchronized Thread

Here is the Java Programming Program of Synchronized Threads of Miss Aisha Khan.

Note : This is Program not Presentation or PDF Kindly Understand the code and Work. Can Ask Anytime for help.


CallMe Class : 
 
package sync_t;

public class CallMe implements Runnable{
   String name;
   Thread th;
   sync_thread t;
 
   public CallMe(String n, sync_thread s)
   {
       name=n;
       t=s;
       th = new Thread(this);
       th.start();
   }
 
 
   public void run()
   {
   t.c(name);
   }
}

sync_thread Class();
 
package sync_t;

public class sync_thread {
synchronized  public void c(String m){
        System.out.println("{"+m);
        try
        {
           Thread.sleep(1000);
        }
        catch(InterruptedException ex)
        {
           
        }
        System.out.println("}");
    }
}


Main Class();




package sync_t;


public class Sync_t {

   
    public static void main(String[] args) {

        sync_thread st = new sync_thread();
       
        CallMe cl = new CallMe("Apt", st);
        CallMe cl2=new CallMe("Owais",st);
       
    }
}
0 comments

Java Getter and Setter Work

Java Getter and Setter Work

Here is the Java Programming Program of Getter and Setter from Miss Aisha Khan.

Note : This is Program not Presentation or PDF Kindly Understand the code and Work. Can Ask Anytime for help.


Student Class :
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gettersetter;

/**
 *
 * @author asp
 */
public class Student {
    int id,age;
    String name;
    public int getid(){
        return id;
    }
    public String getname(){
        return name;
    }
    public int getage(){
        return age;
    }
    public void setid(int i){
        id=i;
    }
    public void setname(String n){
        name=n;
    }
    public void setage(int a){
        age=a;
   }
 
}

Main Class();
 

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gettersetter;

/**
 *
 * @author asp
 */
public class GetterSetter {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Student std=new Student();
        std.setid(45);
        std.setname("Owais");
        std.setage(20);
        System.out.println(std.getid());
        System.out.println(std.getname());
        System.out.println(std.getage());
    }
}
 
 
;