The infamous java.sql.SQLException: No suitable driver found

前端 未结 16 1512
广开言路
广开言路 2020-11-21 05:10

I\'m trying to add a database-enabled JSP to an existing Tomcat 5.5 application (GeoServer 2.0.0, if that helps).

The app itself talks to Postgres just fine, so I kn

16条回答
  •  清酒与你
    2020-11-21 05:28

    Run java with CLASSPATH environmental variable pointing to driver's JAR file, e.g.

    CLASSPATH='.:drivers/mssql-jdbc-6.2.1.jre8.jar' java ConnectURL
    

    Where drivers/mssql-jdbc-6.2.1.jre8.jar is the path to driver file (e.g. JDBC for for SQL Server).

    The ConnectURL is the sample app from that driver (samples/connections/ConnectURL.java), compiled via javac ConnectURL.java.

提交回复
热议问题