Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. Connection in Executable not working

Connection in Executable not working

Scheduled Pinned Locked Moved Java
databasec++javahelpannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MacRaider4
    wrote on last edited by
    #1

    I'm still pretty new to Java so I'm sure I'm missing something. Basically just trying to update a database here so nothing that should be too difficult. If I run the program in Netbeans it runs fine... however if I run the executable from the commandline I get a error: C:\Users\Derek>java -jar "C:\Path...\dist\BirthDayUpdate.jar" Trying the connection now... Connection Exception: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property. This is the connection code where it's failing:

    public Connection openConn() {
    try {
    System.out.println("Trying the connection now...");
    Class.forName("net.sourceforge.jtds.jdbc.Driver");
    conn = java.sql.DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/Intranet");
    System.out.println("Connection ok.");
    } catch (ClassNotFoundException | SQLException e) {
    System.out.println("Connection Exception: " + e.getMessage());
    //e.printStackTrace();
    }
    return conn;
    }

    Thanks in advance!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups