View difference between Paste ID: EWVcRBNZ and Lei7SAbA
SHOW: | | - or go back to the newest paste.
1
/*
2
 * To change this template, choose Tools | Templates
3
 * and open the template in the editor.
4
 */
5
package college;
6
import java.sql.*;
7-
import java.io.*;
7+
 
8-
8+
9
    public static void main(String[] args) {
10
        // TODO code application logic here
11
        Connection con;
12
        PreparedStatement pstmt;
13
        try
14
        {
15
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
16
            con=DriverManager.getConnection("jdbc:odbc:Aakarshap");
17-
            con=DriverManager.getConnection("Jdbc:Odbc:Aakarshap");
17+
18
            pstmt.setString(1, args[0]);
19-
            pstmt.setString(1,args[0]);
19+
20
            if(rst != null)
21-
            if(rst.next())
21+
            while(rst.next())
22
            {
23-
                System.out.println("eName");
23+
                   System.out.println(rst.getString("eName"));
24-
                
24+
25
            else
26-
                else
26+
27
           
28-
            
28+
29
        catch(ClassNotFoundException ce)
30
        {
31
            System.out.println("Error"+ce);
32
        }
33
    catch(SQLException se)
34
    {
35
        System.out.println("Error"+se);
36
    }
37
    }
38
   
39-
    
39+