sql server 2005 - JTDS for MS SQL in android with ADT -


first of maybe repost of: https://stackoverflow.com/questions/13078271/trying-to-use-jtds-in-android-project, not sure, seems there's no answer in post i´ll try here, issue is, im trying connect ms sql 2k5 via jtds (though jtds connection fine, tried on pure java test , connect successfully) on android adt (eclipse) , can't found class in classpath getting typical exception classnotfoundexception, did encounter problem before did know solve (except running program via command line "java -cp" , cause don't know how dalvik, set classpath via "build path" eclipse option, put jar @ libs/, after xxx times of failure getting exception erase jars in libs/ , remove jars via "build path" option, clean project , restart eclipse, set jars again, still got same exception, still pending; configuring varible via windows classpath variable, other ideas guys?

software: windows 7 professional 32 bits jdk 1.7 adt eclipse jtds 1.3 (latest in web page) ms sql 2k5 android 4.2.2

note: if need code, ask (i don't think necessary, same code runs flawless in pure java via netbeans same jtds).

seems hard topic touch (cause of no answer) anyway, solve problem, here leave step step.

1: install ms sql 2k5 (be aware of put db access on mixed (window auth , sql user/pass , extrictly put password sa user mandatory)

2: install ms sql management studio (if want make things more easy, optional) create database via gui , prove inserting (or whatever doing db) android device being done.

3: configure ms sql, go to: sql server configuration manager; sql express protocols; tcp/ip in first tab (protocol) put "enabled" yes, in ip tab, put ipv4 enabled yes, ipv2 enabled yes , @ ipall put tcp port 1433.

4: go jtds-1.2.x-dist folder , enter x86 (if 32 bits os in case 64 x64 folder) sso , copy ntlmauth.dll jdk/bin or jre/bin folder.

5: won't paste code here string connection important thing:

conn = drivermanager.getconnection("jdbc:jtds:sqlserver://192.168.3.67:1433/androiddb", "sa", "1013") 

6: aware ip used connecting android device ipv2 , not ipv4 default 127.0.0.1 or localhost if use of won't work, use ipv2 version.

i test real android device, samsung galaxy tab, if try emulator maybe must use 10.0.2.2 ip, not sure since didn't test it, 1 more important thing, time wrote 1.3.0 jtds wasn't working android 4.2, that's why said in jtds step @ jtds-1.2.x-dist, must use 1.2.x version now.

hope helpful anyone, regards.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -