mickyy's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
18 (0.03 per day)
Joined:
15-August 12
Profile Views:
302
Last Active:
User is offline Feb 20 2013 10:43 AM
Currently:
Offline

Previous Fields

Country:
IN
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Icon   mickyy has not set their status

Posts I've Made

  1. In Topic: Server -Client Connection

    Posted 20 Feb 2013

    Thanks pbl...:)
  2. In Topic: making connection to java program using sql

    Posted 20 Aug 2012

    Still getting the error. I have tried this.
    
    package javaapplication2;
    
    import java.sql.*;
    public class JavaApplication2
    {
        public static void main(String args[])
        {
            int i=0;
            try
            {
                String str="Select fname from students";
                Class.forName("net.sourceforge.jtds.jdbc.Driver");
                Connection con=DriverManager.getConnection("jdbc:jtds:sqlserver://monika-pc/mm");
                System.out.println("Connection open");
                Statement stmt=con.createStatement();
                ResultSet rs=stmt.executeQuery(str);
                System.out.println("fname\t");
                while(i<3)
                {
                    rs.next();
                    String lname=rs.getString("lname");
                    System.out.println(lname);
                    i++;
                    
                }
                    con.close();    
            }
            catch(Exception ex)
            {
                ex.printStackTrace();
            }
        }
    }
    
    


    but I am getting the following error :
    run:
    java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:169)
    	at javaapplication2.JavaApplication2.main(JavaApplication2.java:12)
    BUILD SUCCESSFUL (total time: 1 second)
    
    
    
    
  3. In Topic: making connection to java program using sql

    Posted 19 Aug 2012

    View Postpbl, on 19 August 2012 - 07:41 PM, said:

    Sorry -1 to compensate a wrongly given +1


    Its all right. I know my question is not much of intelligence but and I have never faced this problem in my 1.5 years of Java experience. Although I have posted my question about 3 days ago, still I don't got the answer . So,what's the benefit of getting reputations here.
  4. In Topic: making connection to java program using sql

    Posted 19 Aug 2012

    but by right clicking on MY COMPUTER , the name is " monika-pc"
  5. In Topic: making connection to java program using sql

    Posted 19 Aug 2012

    by writting " C:/>hostname" in cmd ,I am getting an error :
    " 'hostname' is not recognized as an internal or external command,operable program or batch file. "

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Location:
muzaffarnagar,UttarPradesh
Full Name:
Monika Bhatnagar
Years Programming:
1
Programming Languages:
J2SE,J2EE,PL/QL

Contact Information

E-mail:
Click here to e-mail me
Facebook:
http://facebook.com/monika.bhatnagar

Friends

mickyy hasn't added any friends yet.

Comments

Page 1 of 1
  1. Photo

    adityamithal Icon

    23 Nov 2013 - 07:37
    hi
Page 1 of 1