I am trying to create a connection for my spring project, soemthing very simple.

I want to create the configuration fields on my application.properties. I tried with the `spring.datasource` and I dont get any error, but still, I dont get any info, just null pointers... I think the connections have not been made properly.

Here is part of my pom, with this dependencies:

```
<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>4.2.1.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.35</version>
    </dependency>

```

And my properties:

```
server.port=80
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/database
jdbc.username=user
jdbc.password=password

```

I dont get any error, but when I query the database, I always get a null pointer, which makes me think is not working properly, any idea how to configure this?

Thanks

EDIT:

My configuration class

```
@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        ApplicationContext ctx = SpringApplication.run(Application.class, args);

    }

}

```

The controller

```
@Autowired
private MyService myService;

@RequestMapping("/")
public String index() {
    User myUser = myService.findUserById(1L);
    System.out.println(myUser);
    return myUser.getFirstName();
}

```

My Service Implementation

```
@Service
public class MyServiceImpl implements MyService {

    @Autowired
    UserRepository userRepository;

    public User findUserById(Long id){
        return userRepository.findOne(id);
    };
}

```

My Entity

```
@Entity
public class User {

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private Long id;
    private String firstName;
    private String lastName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

}

```

And my repository

```
public interface UserRepository extends CrudRepository<User, Long> {

    //User findOne(Long id); this is a default method
}

```

THE ERROR:

I always get null pointer, even if data exist... and if I change the database password for a wrong one, I dont get any error.. like if it would be ok.