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



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


sai kumar
database contains a message of time
0 Answer(s)      2 years and 5 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
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
message box
message box  How to show the message "invalid username and password" after redirecting the page to the login form
Advertisements
 

 

 

DMCA.com