weixin_41716522
weixin_41716522
采纳率50%
2018-09-15 04:51 浏览 4.5k
已采纳

intellij idea项目已成功部署到服务器,但是没有看到程序执行输出

10

public class UserDaoImple {
public boolean addUser(User user){
System.out.print("没有输出");
try {
Class.forName("com.mysql.jdbc.Driver");
String sql="insert into user values(?,?,?,?,?,?)";
String url="jdbc:mysql://localhost:3306/clothing_samplehh?useSSL=true";
Connection connection = DriverManager.getConnection(url,"root","root");
PreparedStatement ps=connection.prepareStatement(sql);
ps.setString(1,user.getUserId());
ps.setString(2,user.getUserName());
ps.setString(3,user.getUserTel());
ps.setString(4,user.getUserEmail());
ps.setString(5,user.getUserPassword());
ps.setString(6,user.getUserRegisterDate());
connection.close();
ps.close();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
System.out.print("还是没有输出");
return true;
}
}

后台输出内容:

"C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24\bin\catalina.bat" run
[2018-09-15 12:35:51,994] Artifact Q7:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\Administrator.IntelliJIdea2017.3\system\tomcat\未命名_Q7"
Using CATALINA_HOME: "C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24"
Using CATALINA_TMPDIR: "C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24\temp"
Using JRE_HOME: "C:\Program Files\jdk\jdk1.8\jdk1.8.0_151"
Using CLASSPATH: "C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24\bin\bootstrap.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24\bin\tomcat-juli.jar"
15-Sep-2018 12:35:53.136 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.24
15-Sep-2018 12:35:53.138 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Nov 27 2017 13:05:30 UTC
15-Sep-2018 12:35:53.138 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.24.0
15-Sep-2018 12:35:53.138 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 7
15-Sep-2018 12:35:53.138 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.1
15-Sep-2018 12:35:53.139 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
15-Sep-2018 12:35:53.139 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\jdk\jdk1.8\jdk1.8.0_151\jre
15-Sep-2018 12:35:53.139 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_151-b12
15-Sep-2018 12:35:53.139 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
15-Sep-2018 12:35:53.139 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\Administrator.IntelliJIdea2017.3\system\tomcat\未命名_Q7
15-Sep-2018 12:35:53.139 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator.IntelliJIdea2017.3\system\tomcat\未命名_Q7\conf\logging.properties
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
15-Sep-2018 12:35:53.140 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
15-Sep-2018 12:35:53.141 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Administrator.IntelliJIdea2017.3\system\tomcat\未命名_Q7
15-Sep-2018 12:35:53.141 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24
15-Sep-2018 12:35:53.141 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24\temp
15-Sep-2018 12:35:53.141 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3].
15-Sep-2018 12:35:53.141 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
15-Sep-2018 12:35:53.142 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
15-Sep-2018 12:35:54.156 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2m 2 Nov 2017]
15-Sep-2018 12:35:54.317 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
15-Sep-2018 12:35:54.339 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
15-Sep-2018 12:35:54.348 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
15-Sep-2018 12:35:54.348 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
15-Sep-2018 12:35:54.348 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1674 ms
15-Sep-2018 12:35:54.395 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
15-Sep-2018 12:35:54.395 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.24
15-Sep-2018 12:35:54.469 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
15-Sep-2018 12:35:54.479 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
15-Sep-2018 12:35:54.482 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 127 ms
Connected to server
[2018-09-15 12:35:54,678] Artifact Q7:war exploded: Artifact is being deployed, please wait...
15-Sep-2018 12:35:55.306 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[2018-09-15 12:35:55,361] Artifact Q7:war exploded: Artifact is deployed successfully
[2018-09-15 12:35:55,362] Artifact Q7:war exploded: Deploy took 683 milliseconds
15-Sep-2018 12:36:04.470 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24\webapps\manager]
15-Sep-2018 12:36:04.544 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\apache-tomcat-8.5.24\webapps\manager] has finished in [74] ms

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答 默认 最新

  • 已采纳
    qq_40634961 qq_40634961 2018-09-15 06:38

    只是启动了tomcat的服务器,他又不会自动执行这个程序,你这方法不会都没被调用吧,不说别的错没错,第一句话的System.out.print("")打印的东西肯定是要出来的

    点赞 评论 复制链接分享
  • u010019535 dethrive 2018-09-15 07:50

    PreparedStatement ps=connection.prepareStatement(sql);
    ps.setString(1,user.getUserId());
    ps.setString(2,user.getUserName());
    ps.setString(3,user.getUserTel());
    ps.setString(4,user.getUserEmail());
    ps.setString(5,user.getUserPassword());
    ps.setString(6,user.getUserRegisterDate());

    你注册了驱动,创建了连接,准备了SQL语句,但是执行呢? execute方法都没有使用啊

    点赞 评论 复制链接分享

相关推荐