alimirmd 0 Newbie Poster

Hi,
Ya,,,anyone would prefer making their database as secure.But since the question was for the begginers,I have given the default username and password.Later on,u may change it accordingly. In a stand alone PC,the user name and password remain the same,if u have installed the DB with default options.
Anyways,plz let me know if my message was helpful.Even I am a begginer.

Create the ODBC driver in system DNS tab.Don't create it in the User DNS tab.May b that will help.

Regards.....

alimirmd 0 Newbie Poster

Hi,
I am sorry,as I didn't read u r complete code.Why don't u try this,instead of the lengthy code???
String str=beanid.function();
Remember,,,I have given String here,but the datatype of the function and the variable should match.
Suppose if u return some string
String function wxyz()
{
String msg="hello";
return msg;
}
Then in u r JSP, u should write
String str=beanid.wxyz();
So u r str will not b null.I shall see u r program in detail next time and give u the most appropriate answer.Right now,check if this works???Message me if u have any doubts....
all the best,,,bye...

alimirmd 0 Newbie Poster

Hi,
I had the same problem.the main problem is when u r using MS SQL Server,u will b connected to a server.Basically,in Oracle,username would b scott and password would b tiger.Here, the user name and password would b "sa".If u r working on a standalone machine(u r personal PC),then u can give the username and password as "sa".If u r working in a network,then u need to connect to the server first.After u get connected,type username and password as "sa".
In u r program as well,give the username and password as "sa". What I would suggest u is write a simple java program with .java extension.import java.beans in it.That would make it a bean.Write u r sql code there.
In the JSP,use this tag on the top
<jsp:useBean id="somei.d." scope="session" class="package.BeanClassName" />
Whenever u want to access the function of the bean,use beanid.function() to call u r function.

I hope it's too confusing.

*** One more important thing....When u create an ODBC driver,create it in the SystemDSN tab.Don't create it in the userDSN tab.U may ignore the above said lines,but don't ignore this....
I hope it works....All the best....

alimirmd 0 Newbie Poster

Hi,
I think I have already posted this,but may be in some other forum. I need to post this in JSP forum.
Here,all I need is a replacement of goto statement.I want to check for a condition,and if that condition is true,I want the compilet to goto if() statement and repeat if().Since there is no goto in java,can I use labels???Can anyone suggest anything else from this???I am sorry just in case if u find this thread as repeated.
My program is something like this:

java.util.Vector v1991=new java.util.Vector(30);
     int f1=1;
     int f2=10;
     v1991=mb1.Sel(f1,f2);

// Here,mb1 is the bean and sel is the function where I select the
// records between employee number f1 and f2

if(request.getParameter("submitxyz")!=null)
    {
    f1=f1+10;
    f2=f2+10;
    v1991=mb1.Sel(f1,f2);
   }

// submit xyz is my submit button.I get records 11 to 20 on submit
// but I need to get back here and if I click this again, I should get
// records 21 to 30.Again on click,I should get 31 to 40 and so on.

for(int l=l1;l<=(v1991.size()/6);l++) 
    {
    <tr>
    <td width="8%">
    <form method="get" name="form1" action="content.jsp">
    <fieldset>
    <input type="radio" name="radio" value="<%=v1991.get(i)%>">
    </fieldset> 
    </td>
    <td width="7%">
    <%
    out.println(v1991.get(i).toString());
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text222" value="<%=v1991.get(i).toString()   
     %>">
    <%
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text333" value="<%=v1991.get(i).toString()
     %>" >
     <%
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text444" value="<%=v1991.get(i).toString()
     %>">
    <%
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text555" value="<%=v1991.get(i).toString()
     %>">
    <%
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text666" value="<%=v1991.get(i).toString 
      ().toString().substring(0,10)%>">
    <% …
alimirmd 0 Newbie Poster

Hi there,
Look,all u got to do is modify some information in the tables. Before coding it is important that u build a proper flow of data control and define the relationships.All u can do is:
1. In the hotel table,in the type of room table,as soon as the user reserves the room,decrement the value of the number of rooms available.
2.Define a button for the user to check for the availability of the rooms.
3.When the user clicks the button,check if the value of number of rooms is greater han zero(>0).
4.If it is greater than zero,then proceed,else give a message which displays "Sorry,these rooms have been already booked".
I would love to help u.But without looking at the complete code,it is highly impossible for me to guide u exactly where to do what. What I told is just simple if() else() statement.I hope it's clear. If u have any problem please let me know.I hope u got my point.Just define a variable (number of rooms left).As soon as that type of room is booked,decrement it(number of rooms left= number of rooms left-1).
Others,I hope I am not lazy and I hope my english is also o.k.(if not very good)....Enjoy.....

alimirmd 0 Newbie Poster

Hi,
Thank u very much for the reply.But I am new to JSP.I don't know how to use custom tag libraries and JSTL.Can u please help me out with that???I shall b very thankful to u.Even a small help at this moment would b a great help for me.I tried some custom tag libraries programs.But they were out of my reach.Please help me. Thank you....Regards.....

alimirmd 0 Newbie Poster

Hi,
My program is something like this:

java.util.Vector v1991=new java.util.Vector(30);
int f1=1;
int f2=10;
v1991=mb1.Sel(f1,f2);

// Here,mb1 is the bean and sel is the function where I select the
// records between employee number f1 and f2

if(request.getParameter("submitxyz")!=null)
{
f1=f1+10;
f2=f2+10;
v1991=mb1.Sel(f1,f2);
}

// submit xyz is my submit button.I get records 11 to 20 on submit
// but I need to get back here and if I click this again, I should get
// records 21 to 30.Again on click,I should get 31 to 40 and so on.

for(int l=l1;l<=(v1991.size()/6);l++) 
{
<tr>
<td width="8%">
<form method="get" name="form1" action="content.jsp">
<fieldset>
<input type="radio" name="radio" value="<%=v1991.get(i)%>">
</fieldset> 
</td>
<td width="7%">
<%
out.println(v1991.get(i).toString());
i++;
%>
</td>
<td width="17%">
<input type="text" name="text222" value="<%=v1991.get(i).toString() 
%>">
<%
i++;
%>
</td>
<td width="17%">
<input type="text" name="text333" value="<%=v1991.get(i).toString()
%>" >
<%
i++;
%>
</td>
<td width="17%">
<input type="text" name="text444" value="<%=v1991.get(i).toString()
%>">
<%
i++;
%>
</td>
<td width="17%">
<input type="text" name="text555" value="<%=v1991.get(i).toString()
%>">
<%
i++;
%>
</td>
<td width="17%">
<input type="text" name="text666" value="<%=v1991.get(i).toString 
().toString().substring(0,10)%>">
<%
i++;
%>
</td>
</tr>
<%
}
%>

Now,I want to go back to if() statement as soon as I finish this loop.This program would give me 1 to 10 records initially.When I click submitxyz (next) button,I would get 11 to 20.As soon as I get 11 to 20,if I click the button,I want to get 21 to 30.But it doesn't work...
my select query would be select * from emp where empno between f1 and f2;
(There is …