Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. <%@ page import = "java.sql.*, java.util.*, java.io.*, util.*" %>
  2.  
  3. <%
  4.   String temp = request.getParameter("temp");
  5.   String loc="";
  6.   String ttime = paodate.getDateTime()+":00";
  7.  
  8.   System.out.println(temp);
  9.   String adostr=
  10.    "mysql,org.gjt.mm.mysql.Driver,jdbc:mysql://localhost/iot02?user=root&password=passwd1234";
  11.    DBConnection conn1 = new DBConnection(adostr);
  12.    String sqlstr = "insert into temp (temp_val,ttime,loc_val) Values ";
  13.    sqlstr += " ("+temp+",'"+ttime+"','"+loc+"');";
  14.    conn1.execsql(sqlstr);
  15.  
  16. %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement