database contains a message of time

hi

i have one doubt.if the database contains a message of time 05:00 to 06:00 the same msg should be displayed as marquee in the bottom of the page.below is the example if the data base contains a message"hai" with timings 04:00 to 05:00 it shoul display from 04:00 to 05:00 as a marquee similarly every msg will contain certain timings and that message should be displayed in that time only as a marquee.i have done a code but i am not getting the output corectly. below is the code

<%@page import="java.util.Date"%>
// <%@page import="java.util.Calendar"%>
<html>
<body>
    <%@page language="java" import="java.sql.*"%>
    <%@page language="java" import="java.io.*"%>

    <%
        /* String path = request.getContextPath();
        String basePath = request.getScheme() + "://"
                + request.getServerName() + ":" + request.getServerPort()
                + path + "/"; */

        /* Calander c = (new Date()).;
         System.out.println(Short.valueOf((short) c.get(Calendar.HOUR)));

        int val = Short.valueOf((short) c.get(Calendar.HOUR)); */
        Date d = new Date();
        long l = d.getTime();
        String query = "select messag from message where broadcast_in_time>="
                + l + "and broadcast_end_time<=" + l;
         String msg = "";

        try {

            String connectionURL = "jdbc:mysql://localhost:3306/messgbro";
            Connection connection = null;
            Statement statement = null;
            ResultSet rs = null;
            Class.forName("com.mysql.jdbc.Driver").newInstance();
            connection = DriverManager.getConnection(connectionURL, "root",
                    "");
            if (connection == null) {
    %>
    <%="connection is null"%>
    <%
        }
            statement = connection.createStatement();

            String QueryString = "SELECT messag from message";
            rs = statement.executeQuery(QueryString);
        while (rs.next()) {
            msg = rs.getString("messag");
    %><%=msg%>
    <%

    %>
    <FONT SIZE="4" FACE="courier" COLOR=blue><MARQUEE WIDTH=100%
            BEHAVIOR=SCROLL LOOP=10><%=msg%>
        </MARQUEE> </FONT>
    <%
        }
        } catch (Exception except) {
            except.printStackTrace();
        }
    %>
</body>
</html>

please correct it if any corrections are to be made

thanks in advance

View Answers









Related Tutorials/Questions & Answers:
Formatting a Message Containing a Time
Formatting a Message Containing a Time In this section, you will learn how to format a message that contains time. You can format the message in different.... If the message contains any date, time or number, then also it can format
how to search the string arraylist contains database rows?
how to search the string arraylist contains database rows?  i need to search 2 database. one is excel database and another is SQL database. stored the row values into string arraylist. now i want to print the common rows existed
Advertisements
Display error message if data is already inserted in database
Display error message if data is already inserted in database   Display error message if data is already inserted in database Pls help me Thanks
Oracle Database - Insert System Time
Oracle Database - Insert System Time  Hi I want to insert only system time dynamically using a statement but not a prepared statement into Oracle Database please suggest me any code
how to create alert message after data submitted into database
how to create alert message after data submitted into database  I want to create alert message box after data stored into database and redirect to another page, how to do
store the employee ID,name,login time and logout time of the employee in database
in separate columns in a database table..the login and logout time has been stored...store the employee ID,name,login time and logout time of the employee in database  hello...I want to store the employee ID,name,login time and logout
Retrieve Date Time Frm Database - Development process
Retrieve Date Time Frm Database  Hi Friend, Ow to retrieve Date and Time at a time from ms Access database. For Storing data time... is inserted into the database"); statement.close(); connection.close
Time limit for a question from database injsp
Time limit for a question from database injsp  Hellu sir i am... the question and users answer these i want to add a time limit for a question which is fetched from database after the time over i want to show the next
Displaying database table on the windows screen in real time.
Displaying database table on the windows screen in real time.  Problem statement... I have a database table which is running on a remote host .I need to write a program to display this table in a windows form or on a html page
How to extract values from SOAP Response message and insert in database
How to extract values from SOAP Response message and insert in database  Hi I have one urgent requirement in my project which means I need to get... idea of XML.Also I need to update these parsed values into the database. Can you
update database using two queries at a time
update database using two queries at a time  String sql="insert into employee values(emp_seq.nextval,\'"+ename+"\',\'"+eadd+"\',\'"+ephone... to perform insertion in both the tables i.e employee and appusers at the same time
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do? For this i already received the answer. But its converting the time in 24hr format to 12hr format
time
time format hh:mm:ss  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display
time
time display only as hh:mm.  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display in different
time
time  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm. wat to do?   Here is a jsp example that fetch the time from the database and display in different
time
is a jsp example that fetch the time from the database and display in different...retrieved time from mysql database  Hi. I have retrieved time from mysql database. its in th format hh:mm:ss. but i want to display only as hh:mm
database
database  i need to insert time in my database. i need a code to insert time in my database. its very urgent
How to store multiple images in folder and images path in database at a time using jsp?
How to store multiple images in folder and images path in database at a time using jsp?  I wanna browse multiple images in one form and store them in one folder and their path into datrabase
time
time  how to find the current system time between the user login and logout using java
time
time  sir, i want to show system time on a textfield in awt(java). woulk you send me an example of time which can show time in standard format like H:M:S pls help me sir   Display time in JTextField import
A Message-Driven Bean Example
the message. The onMessage( ) method contains the business logic and handles... the information in the message or to store it in a database. A message is delivered... A Message-Driven Bean Example   
Database
will be able to retrieve data from database according to the database time. for example if the database time is 15th then the placeholder will be populated with 15th, even... and the database time is 16th, then the placeholder value will be populated with 16th
Display message automatically using Java Swing
Display message automatically using Java Swing Here we are going to display message automatically after regular interval of time. For this, we have allowed the user to specify  the no of seconds and the message. The method
difference between $message and $$message
difference between $message and $$message  What is the difference between $message and $$message?   Hi friends, $message is a simple variable whereas $$message is a reference variable. Example: $name = 'Bharat
What is the difference between $message and $$message?
What is the difference between $message and $$message?  What is the difference between $message and $$message
message passing
message passing  how message is passed using jade technology
total time calculator (starttime+endtime) in servlet USING DATABASE IN SQL2000 PLZ ANY ONE HELPME
total time calculator (starttime+endtime) in servlet USING DATABASE IN SQL2000 PLZ ANY ONE HELPME   <%-- Document : insertdate Created on : Jul 19, 2013, 3:48:28 PM Author : CG0T4908 --%> <
Java Message Services
that receives  messages. JMS Message: An object that contains the data being... to be running at the time the consumer consumes the message, nor does the consumer need to be running at the time the message is sent. Publish and subscribe
message box
message box  How to show the message "invalid username and password" after redirecting the page to the login form
contains for list in struts2 - Struts
contains for list in struts2  Is there any way to check in the list or for existence of an enum ? Something like list.contains(string). iterating over list I want to do something like Display x display y
database
database  database
database
database  database application
Set Time by using the Prepared Statement
the time in database table by using the PreparedStatement interface of java.sql... This example helps us for setting the time in database table (child) by using... Set Time by using the Prepared Statement   
database
or not. If it is already exist in database, then show a message 'Already exists'. Otherwise, it will show a message 'You can register now!'. 1)availability.jsp...database  i am created one table in mysql database with one
Regular expression contains character - PHP
Regular expression contains character  A PHP script that can check if the regular expression contains character
database
for my project. i planned to develop one real time application. in that i search user required data from the database and rank the results and display it to the user can you tell any real time application which is not currently available? can
Accessing database from JSP
take a example of Books database. This database contains a table named books... in database. After submitting values a table will be showed that contains... Accessing database from JSP   
database
database  the code for initializing the database connection
database
database  i want to let the user select the name of database and then delete that database.......im doing project in swings netbeans
database
database  use of hyperlink to show the data from database
to retrieve message body - Java Beginners
to retrieve message body  hi, Using dbfile system to store message using mysql. dbfile system is to store headers in database and message body in file system . i retrieved message contents like from :, to :, delivered
Copy One Database Table to Another
Copy One Database Table to Another       In this section, you will learn to copy one database table to another database table. That means we copy one table to a different table