Basic configuration for using ScalikeJDBC with Microsoft SQL Server

325 views
Skip to first unread message

Okello Nelson

unread,
Jan 26, 2015, 7:11:41 AM1/26/15
to scalikejdbc...@googlegroups.com
Hi Guys,

I'm new here. So, forgive me if my question sounds dumb. 

I want to use ScalikeJDBC with MS SQL Server. I want to use only the basic operations. Any pointers on how to configure ScalalikeJDBC either with jTDS or Microsoft JDBC Driver?

Thanks in advance.
Nelson.

Kazuhiro Sera

unread,
Jan 26, 2015, 7:49:58 AM1/26/15
to Okello Nelson, scalikejdbc...@googlegroups.com
Although I'm unfamiliar with MS SQL Server, I found some articles by googling 'sqlserver jdbc'. 

I think this article shows you very simple example.
--
You received this message because you are subscribed to the Google Groups "ScalikeJDBC Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalikejdbc-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Okello Nelson

unread,
Jan 26, 2015, 10:35:11 AM1/26/15
to scalikejdbc...@googlegroups.com
Thanks a lot, Kazuhiro, for the quick response.

What I need, however, is how to configure this in ScalikeJDBC. How to configure Data source for SQL Server, for instance, in ScalikeJDBC. All ScalikeJDBC related configs I need to do for it to communicate with SQL Server. I'very already tried using jTDS but it seems insufficient to just specify the driver class alone.

Thanks in advance.
Nelson.

Kazuhiro Sera

unread,
Jan 26, 2015, 10:53:46 AM1/26/15
to Okello Nelson, scalikejdbc...@googlegroups.com
ScalikeJDBC works with driver class loading and simple JDBC settings - JDBC url, username and password. Others are optional.

If you know simply how to configure MS SQL Server JDBC driver, it should be easy to setup ScalikeJDBC too. So I recommended you learning how to use the driver directly.

Okello Nelson

unread,
Jan 27, 2015, 12:39:38 AM1/27/15
to scalikejdbc...@googlegroups.com, cn.o...@gmail.com
Hi Kazuhiro,

I appreciate your help very much. I managed to make it work. For anybody else' benefit, this is what I did:
 - I downloaded the Microsoft JDBC Driver 4.0 and installed it in my Local Maven repository
- I added my local maven repo to the resolver in my SBT build file: resolvers += Resolver.mavenLocal
- I configured the driver class as: com.microsoft.sqlserver.jdbc.SQLServerDriver
- I configured database connection URL using the format: jdbc:sqlserver://ServerHost:PORT;DatabaseName=DB_NAME
- I, of course, added the username and the password to the config.

Once I made it work with Microsoft JDBC Driver, I didn't try making jTDS work. Well, I assume it would follow the same template of doing things. But it's work for another day.

Cheers,
Nelson.


To unsubscribe from this group and stop receiving emails from it, send an email to scalikejdbc-users-group+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages