我需要将sqljdbc42.jar库添加到类路径中,以便连接到Azure SQL数据库。如何(如果可能的话)在Azure Web Service-Web App(Java with Tomcat server)中做到这一点。添加JDBC库还有其他方法吗?
java.sql.SQLException: No suitable driver found for jdbc:sqlserver://XXXXXXX.database.windows.net:1433;database=XXXXXX;user=XXXXX@XXXXX;password=XXXXXXXX;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at common.DBConnection.<init>(DBConnection.java:23)
at servlets.Login.doPost(Login.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Dec 30, 2015 3:04:48 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [servlets.Login] in context with path [/deviceweb] threw exception
java.lang.NullPointerException
at common.DBConnection.addParameter(DBConnection.java:33)
at servlets.Login.doPost(Login.java:78)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
type: Exception report
message:
description: The server encountered an internal error that prevented it from fulfilling this request.
exception:
java.lang.NullPointerException
common.DBConnection.addParameter(DBConnection.java:33)
servlets.Login.doPost(Login.java:78)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note: The full stack trace of the root cause is available in the Apache Tomcat/8.0.30 logs.
连接字符串:
String connectionString = "jdbc:sqlserver://testnabaza.database.windows.net:1433;" + "database=testnabaza;"
+ "user=butterbeast@testnabaza;" + "password=1!qQaaaaaa;" + "encrypt=true;"
+ "trustServerCertificate=false;" + "hostNameInCertificate=*.database.windows.net;" + "loginTimeout=30;";
复制自门户:jdbc:sqlserver://testnabaza.database.windows.net:1433;database=testnabaza;user=butterbeast@testnabaza;password={your_password_here};encrypt=true;trustservercertificate=false;hostnameincertificate=*.database.windows.net;logintimeout=30;
最简单的方法是在创建.zip文件之前,将sqljdbc42.jar文件(可能位于c:\program files\Microsoft SQL Server JDBC Driver\sqljdbc_3.x\enu)添加到本地Java安装的\lib\ext目录中。
要获得最佳帮助,请使用给定的链接https://dzone.com/articles/java-access-sql-azure-jdbc
我正在使用Java代理和Javassist向一些JDK类添加一些日志记录。实际上,当系统加载一些TLS类时,Javassist会向它们添加一些额外的字节码,以帮助我调试一些连接问题。 问题是,考虑到这个类包含在代理jar中: 在我的代理的转换方法中,假设我试图使用javassist调用该类: 你认为这行得通,但我得到了这个: 有没有办法将该类[]添加到应用程序的类路径中?
我正在尝试以编程方式设置一个spring boot应用程序上下文根。上下文根的原因是我们希望从访问应用程序,并将所有控制器路径附加到它。 下面是Web-App的应用程序配置文件。 这是主页面的索引控制器。 应用程序的新根应该位于,但它仍然位于。 我错过了什么导致spring boot没有在请求映射之前添加上下文根?
我希望title本身是描述性的,但要明确的是,我试图在greeting-service.jar中包含(即,error-handling-service.jar)。在构建之后,我在新项目(即TestApplication)中包含了greeting-service.jar,但在执行我得到的TestApplication时(顺便说一句,TestApplication不是一个gradle项目) BaseE
问题内容: 如何在netbeans项目的类路径中添加文件夹(例如,包含arts的资源文件夹)?我设法通过编辑项目的NB生成的jar文件(即其MANIFEST.MF文件+手动复制资源)来手动完成此操作,但是应该有一种方法可以告诉netbeans并注意资源,不是吗? 文件夹结构如下所示: 我不想将艺术品包装到罐子里,因为我希望艺术品可以轻松更换。如果我将art文件夹添加到src文件夹,则NB可以正常编
根据我所知道的,我知道我需要在我的中包含驱动程序,我只是不知道如何从中做到这一点?
我正在尝试使用第三方应用程序来测试Liberty Server18.0,并尝试在Linux上向Liberty Server类路径添加一个库。这个库名为:“com.ibm.websphere.javaee.security.1.0_1.0.21.jar”,它位于Liberty服务器的“/wlp/dev/api/sec”下。 我看得出来,它从来没上过子弹。我如何将这个jar添加到我的defaultSe