connect to sql server using jdbc

后端 未结 2 371
天涯浪人
天涯浪人 2021-01-26 06:26

I am trying to connect to SQL Server 2008 using JDBC. My SQL Server 2008 has windows authentication on it.

My code is

public class T1 {

/**
 * @param         


        
相关标签:
2条回答
  • A ClassNotFoundException likely means that you don't have the SQL*Server drivers available on your classpath

    0 讨论(0)
  • 2021-01-26 07:33

    If you're using Eclipse as your development environment, do the following:

    1. Right-click on your project in eclipse.
    2. Click on "Build Path" -> "Configure Build Path"
    3. You will be in the "Libraries" tab by default. Now, click on "Add External Jars" and add the JDBC Driver Jar for MSSQL Server. (In case you don't have it, download it from JDBC Driver for MSSQL Server 2008
    4. Click on OK and try running your program again.

    Reply back if you still face issues.

    0 讨论(0)
提交回复
热议问题