Guest User

Untitled

a guest
Apr 22nd, 2016
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. video player does show up but it doesnt play video.
  2.  
  3.  
  4. I did upload 1mb video mp4 format in mysql through blob
  5.  
  6. anyone know what's the problem here?
  7.  
  8. [code]<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  9. pageEncoding="ISO-8859-1"%>
  10. <%@ page import="java.sql.*" %>
  11. <% Class.forName("com.mysql.jdbc.Driver"); %>
  12.  
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  14. <html>
  15. <head>
  16. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  17. <title>Insert title here</title>
  18. </head>
  19. <FORM ACTION="playdb.jsp" METHOD="POST">
  20.  
  21. <BR>
  22. <INPUT TYPE="TEXT" NAME="username">
  23. <BR>
  24. <INPUT TYPE="SUBMIT" value="Submit">
  25. <%
  26. Connection c = DriverManager.getConnection("jdbc:mysql://localhost/test","root","5845#Mankind");
  27.  
  28. Statement statement = c.createStatement();
  29.  
  30.  
  31.  
  32. String id = request.getParameter("username");
  33.  
  34.  
  35. ResultSet resultset =
  36. statement.executeQuery("select video from applicant where username = '"+id+"'") ;
  37.  
  38. if(!resultset.next()) {
  39. } else {
  40. %>
  41. <body><div class="media">
  42.  
  43. <video width="320" height="240" controls>
  44. <source src="<%=resultset.getString("video")%>" type="video/mp4">
  45. <source src="movie.ogg" type="video/ogg">
  46. </video>
  47. </div>
  48. </div>
  49. </body>
  50. <%
  51. }
  52. %>
  53. </FORM>
  54. </html>
  55. [/code]
Add Comment
Please, Sign In to add comment