LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 May 7 2014

Rodster
Member

Connecting to the sql server on my laptop

I really hope this thread does not get deleted because i really need your help guys :)

So in my final project my android app has to connect to my mssql database. It seems everything on the internet handles mysql and apache and its like mssql does not exist.

Any advice or guidance is much appreciated

Last edited by Rodster (May 7 2014)

Offline

#2 May 7 2014

Joe
Member

Re: Connecting to the sql server on my laptop

There is almost no difference in the way you should handle a connection between MySQL and MS SQL. Where are you having issues exactly? Where are you stuck? Do you have some code to show?

Offline

#3 May 8 2014

amkahal
Member

Re: Connecting to the sql server on my laptop

my question is why do you use MSSQL with Android ?

Last edited by amkahal (May 8 2014)

Offline

#4 May 8 2014

longbit
Member

Re: Connecting to the sql server on my laptop

the android app has to establish a direct connection with the database ?
that is wrong on many levels...
better way to is the communicate with the DB via http request through a webserver.
as Rahmu pointed, please clarify your problem more.

Offline

#5 May 8 2014

Rodster
Member

Re: Connecting to the sql server on my laptop

My problem lies in the middle part the webservice and the
Php scripts. I have written the json parse in my app

Offline

#6 May 10 2014

Rodster
Member

Re: Connecting to the sql server on my laptop

So i have given up on using my laptop with mssql and went with mysql. I have set up a mysql database hosted
On 000webhost.com any now my biggest problem is php scripts :(

Offline

#7 May 10 2014

Joe
Member

Re: Connecting to the sql server on my laptop

@Rodster: you realize that you're just posting messages to say "I have a problem" and you're not taking the time to explain what your problem is. What are you trying to do? What's blocking you? What on earth is PHP doing in there?

And more importantly, what do you expect from us?

longbit wrote:

the android app has to establish a direct connection with the database ?
that is wrong on many levels...

I see what you mean, but that's debatable. I can think of a few use cases where connecting from a phone to a database would make sense.

Offline

#8 May 10 2014

rtp
Member

Re: Connecting to the sql server on my laptop

The flow is as follows:

  1. Android makes an http request on Php

  2. Php goes and gets the data from the database (mysql or sql)

  3. Php turns the result into JSON

  4. Returns it to Android as JSON

  5. Android parses the json to an object

  6. And vwala you got your data as an object

Offline

#9 May 10 2014

Rodster
Member

Re: Connecting to the sql server on my laptop

Thanks rtp things are beging to make sense.
@rahmu i just wanted some guidance and advice. Like how rtp explained it. Now iam currently researching some php scripts that can help me. I have found the script that establish connection

Offline

Board footer