connect DB2 with Java

后端 未结 9 1659
梦谈多话
梦谈多话 2021-02-02 16:28

I need to connect DB2 with Java. Kindly help me to connect DB2 with java in ECLIPSE. It would be of great help if you could guide me step by s

9条回答
  •  误落风尘
    2021-02-02 16:40

    Well, you first need to have the DB2 Driver in your classpath; namely the db2jcc4.jar file. A syntax mistake that I noticed is:-

    You have the line as follows

    conn = DriverManager.getConnection("jdbc:db2:sabarish","db2admin","Murugasaranam"); _______________________________________^^^_________________________________

    You should add two forward slash characters(/) after db2: and before sabarish like this

    conn = DriverManager.getConnection("jdbc:db2://sabarish","db2admin","Murugasaranam")

提交回复
热议问题