Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

1 Visitor Messages

  1. sir, i create a application with database but this is showing an error.
    import java.sql.*;
    public class MYSQLDEMO {


    public static void main(String[] args) throws SQLException,ClassNotFoundException{
    String driverClass="sun.jdbc.odbc.JdbcOdbcDriver";
    String url="jdbcdbc:msqldsn";
    String user="root";
    String password="test";
    Class.forName(driverClass);
    Connection con=DriverManager.getConnection(url,user,password) ;
    Statement st=con.createStatement();
    String sql="insert into student values(23,nit,45)";
    st.executeUpdate(sql);
    System.out.println("query executed");
    con.close();

    }

    }
    please can u see the program and tell me if i did any mistake.
    after running of the program it shows like this


    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknow n Source)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at MYSQLDEMO.main(MYSQLDEMO.java:11)
Showing Visitor Messages 1 to 1 of 1
About bhagyashree devji

Basic Information

About bhagyashree devji
Java Skill Level:
Intermediate

Statistics


Total Posts
Total Posts
1
Posts Per Day
0.00
Visitor Messages
Total Messages
1
Most Recent Message
January 21st, 2013 06:51 AM
Total Thanks
Total Thanks
0
  • Thanked 0 Times in 0 Posts
General Information
Last Activity
January 21st, 2013 07:05 AM
Join Date
January 21st, 2013