<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I use SAS 9.4 jdbc driver in the Spring boot application in Developers</title>
    <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/591325#M522</link>
    <description>&lt;P&gt;I updated the example on GitHub to include an insert.&amp;nbsp; Good luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/FriedEgg/SAS-JDBC-Spring-Boot-Example" target="_blank" rel="noopener"&gt;https://github.com/FriedEgg/SAS-JDBC-Spring-Boot-Example&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2019 22:35:15 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2019-09-24T22:35:15Z</dc:date>
    <item>
      <title>How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/562024#M406</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am building a Spring boot web application using SAS as database.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the application.properties file, I use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;spring.datasource.url=jdbc:sasiom://link:port&lt;BR /&gt;spring.datasource.username=****&lt;BR /&gt;spring.datasource.password=*****&lt;BR /&gt;spring.datasource.driver-class-name=com.sas.rio.MVADriver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I run the application on Tomcat, it will throw:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:&lt;/P&gt;&lt;P&gt;Property: driverclassname&lt;BR /&gt;Value: com.sas.rio.MVADriver&lt;BR /&gt;Origin: "driverClassName" from property source "source"&lt;BR /&gt;Reason: Unable to set value for property driver-class-name&lt;/P&gt;&lt;P&gt;Action:&lt;/P&gt;&lt;P&gt;Update your application's configuration&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the jdbc driver jar files are included in the class path. Can anyone give me some sample codes to create the spring datasource with SAS 9.4?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 17:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/562024#M406</guid>
      <dc:creator>SASEdmonton</dc:creator>
      <dc:date>2019-05-28T17:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/562719#M408</link>
      <description>&lt;P&gt;Make sure you have all the correct libraries in your classpath:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;log4j.jar&lt;/LI&gt;
&lt;LI&gt;sas.core.jar&lt;/LI&gt;
&lt;LI&gt;sas.security.sspi.jar&lt;/LI&gt;
&lt;LI&gt;sas.svc.connection.jar&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your application.properties&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;spring.datasource.url=jdbc:sasiom://workspace.server.hostname.com:8591
spring.datasource.username=myusername
spring.datasource.password=mypassword
spring.datasource.driver-class-name=com.sas.rio.MVADriver&lt;/PRE&gt;
&lt;P&gt;DemoApplication.java&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;package com.github.friedegg.demo;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

import javax.sql.DataSource;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

@SpringBootApplication
public class DemoApplication {

  public static void main(String[] args) {
    SpringApplication.run(DemoApplication.class, args);
  }

  @Bean
  public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
    return args -&amp;gt; {
      DataSource ds = (DataSource)ctx.getBean("dataSource");
      JdbcTemplate jdbcTemplate = new JdbcTemplate(ds);
      String SQL = "select * from sashelp.class";
      List&amp;lt;Student&amp;gt; students = jdbcTemplate.query(SQL, new SashelpClassMapper());
      for (Student student : students) {
        System.out.printf("%s is %d years old.%n", student.name, student.age);
      }
    };
  }

  class Student {
    private String name;
    private Integer age;

    public Integer getAge() {
      return age;
    }

    public void setAge(Integer age) {
      this.age = age;
    }

    public String getName() {
      return name;
    }

    public void setName(String name) {
      this.name = name;
    }
  }

  class SashelpClassMapper implements RowMapper&amp;lt;Student&amp;gt; {
    public Student mapRow(ResultSet rs, int rn) throws SQLException {
      Student student = new Student();
      student.setName(rs.getString("name"));
      student.setAge(rs.getInt("age"));
      return student;
    }
  }
}
&lt;/PRE&gt;
&lt;P&gt;Console Output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Alfred   is 14 years old.
Alice    is 13 years old.
Barbara  is 13 years old.
Carol    is 14 years old.
Henry    is 14 years old.
James    is 12 years old.
Jane     is 12 years old.
Janet    is 15 years old.
Jeffrey  is 13 years old.
John     is 12 years old.
Joyce    is 11 years old.
Judy     is 14 years old.
Louise   is 12 years old.
Mary     is 15 years old.
Philip   is 16 years old.
Robert   is 12 years old.
Ronald   is 15 years old.
Thomas   is 11 years old.
William  is 15 years old.
&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2019 21:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/562719#M408</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2019-05-30T21:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/562741#M409</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19924"&gt;@FriedEgg&lt;/a&gt;&amp;nbsp;Thanks for your reply. After I add log4j.jar, the compiling error is solved.&amp;nbsp;That is great. Have you ever tried to use&amp;nbsp;ORM like hibernate and mybatis with SAS? When I use mybatis-spring-boot-starter, it will throw the following errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Driver does not support get/set network timeout for connections. (com.sas.rio.MVAConnection.getNetworkTimeout()I)

 

com.sas.rio.MVASQLExceptionUnsupported: Method not supported.

at com.sas.rio.MVAStatement.setQueryTimeout(MVAStatement.java:508) ~[connection-1.jar:904300.0.0.20150204190000_v940m3]

 

at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setQueryTimeout(HikariProxyPreparedStatement.java) [HikariCP-2.7.9.jar:na]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 22:58:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/562741#M409</guid>
      <dc:creator>SASEdmonton</dc:creator>
      <dc:date>2019-05-30T22:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/563873#M415</link>
      <description>&lt;P&gt;It is definitely possible, but it's important to note that the JDBC driver isn't exactly... complete... (by which, I mean, a number of features that other databases more commonly used in this context are missing, such as the various timeouts)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The biggest issue you're going to have with something like mybatis is that automapping uses the method ResultSetMetadata.getColumnLabel, which, in SAS returns the column label, naturally.&amp;nbsp; But in general it returns the column name alias.&amp;nbsp; This difference in behavior causes mybatis to fail and this can be corrected by setting the configuration property use-column-label=false.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;mybatis.configuration.use-column-label=false&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 21:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/563873#M415</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2019-06-05T21:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/563887#M416</link>
      <description>&lt;P&gt;Hi FriedEgg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I have updated the setting. It still returns the errors:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Driver does not support get/set network timeout for connections. (com.sas.rio.MVAConnection.getNetworkTimeout()I)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any sample project I can check to set up the environment?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 20:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/563887#M416</guid>
      <dc:creator>SASEdmonton</dc:creator>
      <dc:date>2019-06-05T20:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/563891#M417</link>
      <description>&lt;P&gt;This shows up as a info line in the log, to me.&amp;nbsp; Possibly a difference in our versions of SAS (I am using 9.4m6).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="FriedEgg/SAS-JDBC-Spring-Boot-Example" href="https://github.com/FriedEgg/SAS-JDBC-Spring-Boot-Example" target="_self"&gt;https://github.com/FriedEgg/SAS-JDBC-Spring-Boot-Example&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 21:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/563891#M417</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2019-06-05T21:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/567471#M424</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. It works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another question. How can I assign the SAS library if I use mybatis? Previously,&amp;nbsp;we use sasLanguage to submit statements. But there is no way to do the same thing when using mybatis. Because we are using sas share server, we need to assign the library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 17:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/567471#M424</guid>
      <dc:creator>SASEdmonton</dc:creator>
      <dc:date>2019-06-20T17:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/568611#M425</link>
      <description>&lt;P&gt;You have three better options (in order of my opinion):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Define the libraries in metadata&lt;/P&gt;
&lt;P&gt;2) Define the libraries in the jdbc connection.&amp;nbsp; Something like the following&lt;/P&gt;
&lt;P&gt;3) Put the libname into the application server autoexec&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;spring.datasource.connectionProperties: librefs="appdev 'C:\foo\bar\data'"&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 24 Jun 2019 23:11:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/568611#M425</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2019-06-24T23:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/569628#M453</link>
      <description>&lt;P&gt;Hi, Thanks for your reply. We use the third way to connect to the SAS share server. The select query works fine. But it will throw error when I do the insert query. Do you know why the method is not supported? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;package com.demo.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import com.demo.model.User;

@Service
@Mapper
public interface UserDAO {
	String TABLE_NAME = " sc.test ";
	String INSERT_FIELDS = " age, name, gender ";

	@Select({ "select * ", " from ", TABLE_NAME })
	List&amp;lt;User&amp;gt; getAllUsers();

	@Insert({ "insert into ", TABLE_NAME, "(", INSERT_FIELDS,
			") values (#{age},#{name},#{gender})" })
	void addUser(User user);
}&lt;/PRE&gt;&lt;PRE&gt;### Error updating database.  Cause: com.sas.rio.MVASQLExceptionUnsupported: Method not supported.
### SQL: insert into   sc.test  (  age, name, gender  ) values (?,?,?)
### Cause: com.sas.rio.MVASQLExceptionUnsupported: Method not supported.
; ]; Method not supported.; nested exception is com.sas.rio.MVASQLExceptionUnsupported: Method not supported.] with root cause

com.sas.rio.MVASQLExceptionUnsupported: Method not supported.
	at com.sas.rio.MVAConnection.prepareStatement(MVAConnection.java:1025) ~[connection-1.jar:904300.0.0.20150204190000_v940m3]
	at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:325) ~[HikariCP-2.7.9.jar:na]
	at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-2.7.9.jar:na]&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jun 2019 20:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/569628#M453</guid>
      <dc:creator>SASEdmonton</dc:creator>
      <dc:date>2019-06-27T20:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/572457#M460</link>
      <description>&lt;P&gt;Can anyone from SAS help answer this question? Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 18:00:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/572457#M460</guid>
      <dc:creator>SASEdmonton</dc:creator>
      <dc:date>2019-07-10T18:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/573131#M465</link>
      <description>No thoughts immediately come to mind as to why your insert would have issues, but I do want to comment on you driver choice.  Why use the MVA driver and define a library for SAS Share instead of using the SAS Share driver and connecting to that service directly?</description>
      <pubDate>Fri, 12 Jul 2019 15:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/573131#M465</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2019-07-12T15:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/573148#M467</link>
      <description>&lt;P&gt;Because SAS share server is a bit slow for us, we want to connect to the work space server and only use share server for the queries which will modify the tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you add the insert query example in your sample project? It would be really helpful for us. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 15:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/573148#M467</guid>
      <dc:creator>SASEdmonton</dc:creator>
      <dc:date>2019-07-12T15:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/589214#M501</link>
      <description>&lt;P&gt;We still cannot get the insert query work. Can any SAS experts help us with this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 23:00:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/589214#M501</guid>
      <dc:creator>SASEdmonton</dc:creator>
      <dc:date>2019-09-16T23:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use SAS 9.4 jdbc driver in the Spring boot application</title>
      <link>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/591325#M522</link>
      <description>&lt;P&gt;I updated the example on GitHub to include an insert.&amp;nbsp; Good luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/FriedEgg/SAS-JDBC-Spring-Boot-Example" target="_blank" rel="noopener"&gt;https://github.com/FriedEgg/SAS-JDBC-Spring-Boot-Example&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 22:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/How-can-I-use-SAS-9-4-jdbc-driver-in-the-Spring-boot-application/m-p/591325#M522</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2019-09-24T22:35:15Z</dc:date>
    </item>
  </channel>
</rss>

