Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet database contains a message of time

Have Programming Question? Ask it here!
 
 
 


sai kumar
database contains a message of time
0 Answer(s)      2 years and 3 months ago
Posted in : JSP-Servlet


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


Advertisement
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
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
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
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
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
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
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
message box
message box  How to show the message "invalid username and password" after redirecting the page to the login form
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
A Message-Driven Bean Example
in the message or to store it in a database. A message is delivered to a message... A Message-Driven Bean Example   ... messages asynchronously,  a Message-driven bean is used. Message driven
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
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
Java Message Services
. JMS Message: An object that contains the data being transferred between... at the time the message is sent. Publish and subscribe model The publish- subscribe... Java Message Services      
Regular expression contains character - PHP
Regular expression contains character  A PHP script that can check if the regular expression contains character
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 arraylist contains
contains() method is used to check whether the element is present or not. It returns boolean value i.e. true or false. Example of Java Arraylist Contains import java.util.ArrayList; import java.util.List; public
database
database  i need to insert time in my database. i need a code to insert time in my database. its very urgent
Java Message Services - JMS
Java Message Services  What is Java Message Services
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
Example of contains method of hashset in java.
Example of contains method of hashset in java. The contains() is a method of hashset. It is used for checking that the given number is available in hashset or not. It returns only boolean value.If number is present in hashset
Objective C Message Passing
Objective C Message Passing  What exactly a message passing means in Objective C? and how can i pass a message to a method
time ()
PHP time() Function The time() returns the current time  measured...;). Syntax of time() Function in PHP time(void) Parameter of time() Function in PHP void - void is optional parameter.  Example of time
Javascript alert message
Javascript alert message   How to send an alert message to a user in JavaScript
Message Context in AXIS
Message Context in AXIS  Is there any method in Axis classes to het the size of IN and OUT Message Conetext
Message Resource Bundle work.
Message Resource Bundle work.  How does Value replacement in Message Resource Bundle work
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
how to send message
how to send message  how to send message for mobile in server
javascript dom error-message
javascript dom error-message  javascript dom error-message
 

 

 

DMCA.com