Click here to Skip to main content
15,892,005 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Java, JDBC driver: Argh! Pin
Sander Rossel29-Jun-20 11:42
professionalSander Rossel29-Jun-20 11:42 
GeneralRe: Java, JDBC driver: Argh! Pin
raddevus29-Jun-20 11:56
mvaraddevus29-Jun-20 11:56 
GeneralRe: Java, JDBC driver: Argh! Pin
Mycroft Holmes29-Jun-20 12:47
professionalMycroft Holmes29-Jun-20 12:47 
GeneralRe: Java, JDBC driver: Argh! Pin
kalberts29-Jun-20 12:49
kalberts29-Jun-20 12:49 
GeneralRe: Java, JDBC driver: Argh! Pin
raddevus29-Jun-20 18:05
mvaraddevus29-Jun-20 18:05 
GeneralRe: Java, JDBC driver: Argh! Pin
Jon McKee29-Jun-20 14:20
professionalJon McKee29-Jun-20 14:20 
GeneralRe: Java, JDBC driver: Argh! Pin
raddevus29-Jun-20 18:13
mvaraddevus29-Jun-20 18:13 
GeneralRe: Java, JDBC driver: Argh! Pin
Jon McKee29-Jun-20 20:35
professionalJon McKee29-Jun-20 20:35 
I have the following example working. Hopefully it helps point you in the right direction.

Folder structure:
jdbctest
 - classes
 - lib
   - mssql-jdbc-8.2.2.jre8.jar
 - src
   - JDBCTest.java

Files:
JDBCTest.java
Java
import java.sql.Driver;
import java.sql.DriverManager;

public class JDBCTest {

    public static void main(String[] args)
    {
        try
        {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            Driver sqlServerDriver = DriverManager.getDriver("jdbc:sqlserver://localhost");
            System.out.println(
                sqlServerDriver.toString()
                + ":" + sqlServerDriver.getMajorVersion()
                + "." + sqlServerDriver.getMinorVersion()
            );
        }
        catch (Exception ex)
        {
            System.out.println(ex.getMessage());
        }
    } 
}

Commands (run from project directory):
javac -d classes src/JDBCTest.java
java -classpath classes:lib/* test.JDBCTest

It should print out "SQLServerDriver:1:8.2".
GeneralRe: Java, JDBC driver: Argh! Pin
raddevus30-Jun-20 2:03
mvaraddevus30-Jun-20 2:03 
GeneralRe: Java, JDBC driver: Argh! : tried it Pin
raddevus30-Jun-20 2:49
mvaraddevus30-Jun-20 2:49 
GeneralRe: Java, JDBC driver: Argh! Pin
raddevus30-Jun-20 3:05
mvaraddevus30-Jun-20 3:05 
NewsBad guys are not allowed to use iPhones Pin
ZurdoDev29-Jun-20 10:31
professionalZurdoDev29-Jun-20 10:31 
GeneralRe: Bad guys are not allowed to use iPhones Pin
Super Lloyd29-Jun-20 13:44
Super Lloyd29-Jun-20 13:44 
GeneralRe: Bad guys are not allowed to use iPhones Pin
DRHuff29-Jun-20 15:49
DRHuff29-Jun-20 15:49 
GeneralRe: Bad guys are not allowed to use iPhones Pin
Amarnath S29-Jun-20 18:48
professionalAmarnath S29-Jun-20 18:48 
GeneralRe: Bad guys are not allowed to use iPhones Pin
obermd30-Jun-20 4:25
obermd30-Jun-20 4:25 
GeneralThe mystery of the disappearing socks Pin
CodeWraith29-Jun-20 7:13
CodeWraith29-Jun-20 7:13 
GeneralRe: The mystery of the disappearing socks Pin
Sander Rossel29-Jun-20 8:22
professionalSander Rossel29-Jun-20 8:22 
GeneralRe: The mystery of the disappearing socks Pin
CodeWraith29-Jun-20 9:08
CodeWraith29-Jun-20 9:08 
GeneralRe: The mystery of the disappearing socks Pin
Sander Rossel29-Jun-20 11:34
professionalSander Rossel29-Jun-20 11:34 
GeneralRe: The mystery of the disappearing socks Pin
RickZeeland29-Jun-20 8:37
mveRickZeeland29-Jun-20 8:37 
GeneralRe: The mystery of the disappearing socks Pin
OriginalGriff29-Jun-20 9:43
mveOriginalGriff29-Jun-20 9:43 
GeneralRe: The mystery of the disappearing socks Pin
CodeWraith29-Jun-20 10:07
CodeWraith29-Jun-20 10:07 
GeneralRe: The mystery of the disappearing socks Pin
charlieg30-Jun-20 17:28
charlieg30-Jun-20 17:28 
GeneralRe: The mystery of the disappearing socks Pin
TheGreatAndPowerfulOz29-Jun-20 9:59
TheGreatAndPowerfulOz29-Jun-20 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.