Question: I'm creating my first Java program that pulls data from a **MySql database**. I'm having trouble getting the result from a query to print in console. My program compiles without error but **out.print command not displaying content in console**. I'm using Intellij IDEA 15.0.2.

```
import java.sql.*;
import static java.lang.System.*;

public class Main {
public static void main(String[] args) {
String url = "jdbc:mysql://localhost:3306/animal";
    String user = "username";
    String pwd = "password";
    try {
        Connection connection =
             DriverManager.getConnection(url, user, pwd); // Get Connection
     Statement statement = connection.createStatement(); // Create Statement
        String query = "SELECT * FROM animal";
      ResultSet resultSet = statement.executeQuery(query); // Execute Query
        while (resultSet.next()) { // Process Results
            out.print(resultSet.getInt("animal_id"));

        }
    } catch (SQLException se) { }
}
}

```

Answer: 
To print out to console the correct command is

```
System.out.print("Whatever you want to print");

```

not

```
out.print("Whatever you want to print");

```
The problem was with the database driver. I needed to use the **forName method()**, and add the driver url for MySql. After I successfully implemented this class I was able to create sql queries without issue. Thanks for the tip with the exception handling @Senthil Vidhiyakar

```
try {
        Class.forName("com.mysql.jdbc.Driver");
        System.out.print("Working");
    }
    catch (Exception e){ System.out.println("Not working");} 

```

I also had to connect the mysql connector jar. The process for doing this in Intellij IDEA is as follows.

**File >> Project Structure** "The project structure window will appear then on the **left side menu *click Modules*** in the main content area **click on the Dependencies tab**. Next **click the green +**. *Choose option 1 JARs or directories*. Finally, navigate to the mysql connector jar. Then **click apply, and ok**."