title: How to use MyBatis instead of Spring DataSource?
body: <p>My goal is to configure everything using MyBatis for the SQL operations. Every tutorial I found does not mention about <code>application.properties</code> yet if I did not configure <code>application.properties</code> it will throws an error.</p>
  <p><strong>I wish to not configure <code>spring.datasource.*</code>, instead I wish to configure everything using MyBatis.</strong></p>
  <p>Error #1</p>
  <pre><code>***************************
  APPLICATION FAILED TO START
  ***************************
  
  Description:
  
  Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
  
  Reason: Failed to determine a suitable driver class
  
  
  Action:
  
  Consider the following:
      If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
      If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
  
  
  Process finished with exit code 1
  </code></pre>
  <p>Error #2</p>
  <pre><code>WARN 2560 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.]' package. Please check your configuration.
  </code></pre>
  <p>==== This configuration does not throws Error #1.</p>
  <p>application.properties</p>
  <pre><code>spring.datasource.url=jdbc:sqlserver://localhost:1433;databaseName=javatest
  spring.datasource.username=java
  spring.datasource.password=java
  spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
  </code></pre>
  <p>mybatis-config.xml</p>
  <pre><code>&lt;configuration xmlns=&quot;http://mybatis.org/schema/mybatis-config&quot;&gt;
      &lt;environments default=&quot;development&quot;&gt;
          &lt;environment id=&quot;development&quot;&gt;
              &lt;transactionManager type=&quot;JDBC&quot;&gt;&lt;/transactionManager&gt;
              &lt;dataSource type=&quot;POOLED&quot;&gt;
                  &lt;property name=&quot;driver&quot; value=&quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;/&gt;
                  &lt;property name=&quot;url&quot; value=&quot;jdbc:sqlserver://localhost:1433;databaseName=javatest&quot;/&gt;
                  &lt;property name=&quot;username&quot; value=&quot;java&quot;/&gt;
                  &lt;property name=&quot;password&quot; value=&quot;java&quot;/&gt;
              &lt;/dataSource&gt;
          &lt;/environment&gt;
      &lt;/environments&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>partial pom.xml</p>
  <pre><code>    &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mybatis.spring.boot&lt;/groupId&gt;
              &lt;artifactId&gt;mybatis-spring-boot-starter&lt;/artifactId&gt;
              &lt;version&gt;2.1.4&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.microsoft.sqlserver&lt;/groupId&gt;
              &lt;artifactId&gt;mssql-jdbc&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>