You are not logged in. Please login at to post your questions!


[closed] i am getting error while connecting to database (com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:

this is my code

public class DataBaseConnectivity {
public static void main(String args[])throws SQLException, ClassNotFoundException
    //String url="";
    //String uname="";
    //String pswd="";
    Class.forName("com.mysql.jdbc.Driver"); // loading and registering the driver
    Connection con;
    Statement stmt=con.createStatement();  
    ResultSet rs=stmt.executeQuery("select * from BankHolderDetails");  
    System.out.println(rs.getInt(1)+"  "+rs.getString(2)+"  "+rs.getString(3));  


asked 14 Feb, 03:00

sandhya06's gravatar image

accept rate: 0%

closed 17 Feb, 07:48

meooow's gravatar image

6★meooow ♦

The question has been closed for the following reason "Question is off-topic or not relevant" by meooow 17 Feb, 07:48

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 14 Feb, 03:00

question was seen: 85 times

last updated: 17 Feb, 07:48