Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By victaino

Thread: l connection to an sql server database

  1. #1
    Join Date
    May 2012
    Posts
    10
    Rep Power
    0

    Default l connection to an sql server database

    Hi,

    to connect an sql server database called clients, i used this instruction

    Java Code:
    ConnexionSQL = DriverManager.getConnection("jdbc:odbc:bdd_clients","","");
    the String connection is that one
    "jdbc:odbc:bdd_clients","",""
    all works very well , but now i would like to replace this String connection with a new one which seems like this

    jdbc:sqlserver://localhost;databaseName=Clients;integratedSecurity= true;
    I have tried but it does not work.
    information : the database is called Clients and is installed on my localhost.

    Can you tell me how i can resolve this situation.

    Thanks a lot for your help.

    curious_programmer

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,995
    Blog Entries
    7
    Rep Power
    19

    Default Re: l connection to an sql server database

    What happens when you replace "localhost" by "127.0.0.1"?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    victaino is offline Member
    Join Date
    Apr 2012
    Posts
    38
    Rep Power
    0

    Default Re: l connection to an sql server database

    what error message do you get when you try to connect?
    Tolls likes this.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,438
    Rep Power
    18

    Default Re: l connection to an sql server database

    This ^
    Without the exception/error/whatever we have no idea what problem your are encountering.
    It could be a simple ClassNotFoundException.
    Please do not ask for code as refusal often offends.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: l connection to an sql server database

    I removed a spam post from the thread and banned the spammer for life. I'm also reporting the spammer on several other forums.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Database connection with derby on server
    By idbirohit in forum New To Java
    Replies: 0
    Last Post: 09-23-2011, 10:18 AM
  2. Database connection for server
    By JavaDreams in forum New To Java
    Replies: 5
    Last Post: 03-14-2011, 10:25 AM
  3. Replies: 0
    Last Post: 12-01-2009, 10:01 PM
  4. Database Connection
    By CompleteBeginner in forum New To Java
    Replies: 2
    Last Post: 05-24-2008, 02:30 PM
  5. Database connection
    By oaklander in forum New To Java
    Replies: 2
    Last Post: 11-12-2007, 11:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •