Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,495 members, 7,819,807 topics. Date: Tuesday, 07 May 2024 at 12:07 AM

Sbucareer's Posts

Nairaland Forum / Sbucareer's Profile / Sbucareer's Posts

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (of 38 pages)

Programming / Re: Java Programming For Dummies by sbucareer(f): 11:51am On Mar 28, 2007

J2EE and .NET are tools used in developing enterprise application. SAP in the other hand is an enterprise solution that has many areas of intelligent-application covered i.e.

1. ABAP
2. CRM
3. ERP
4. Data mining
5. Financials
6. Human Resources
7. Customer Relationship Management
8. Supplier Relationship Management
9. Product Lifecycle Management
10. Supply Chain Management
11. Business Intelligence
12 etc.

You simply buy one and customize it to suit your enterprise. If you want to develop these modules from ground up using J2EE, .NET or any enterprise solution it would take you years to complete and more years to debug. Before you finish the Beta stages you may have retired due to age or lack of intelligence and waste of resource within your organisation.

SAP (Systems Analysis and Product) covers all these areas with years of research and debug. SAP has been around since 1972, founded by ex-IBM employees in Mannheim, Germany.

Their focus was developing SAP that solves or present an enterprise application that would address issues like

1. To cut waste
2. Provide business intelligence
3. Solve personnel and accounting problems
4. To solve supply chain management
5. To solve production issues
6. Provide application to solve historical data (Data warehouse)
7. etc.

You can use J2EE and .NET to develop these applications but it would take time and effort. Some smart organization use SAP to leverage that.

I personally, I am learning SAP; I am concentrating on ABAP (Advanced Business Application Programming) module, since I came from web application development, and designing business application. ABAP, it is currently positioned as the language for programming SAP's Web Application Server, part of its NetWeaver platform for building business applications. Its syntax is somewhat similar to COBOL.

As soon as I finished and work for like one year with it, I am facing Nigeria with full force. There are many opportunities with ABAP in Nigerian because it is geared to web development in SAP.

I don't really know the database SAP uses to store and manipulate its data. But Oracle is another different unit to learn. If you are in DBA, I will encourage you to learn Oracle.
Programming / Re: Do Nigerian Banks Have An Api To Their Database. by sbucareer(f): 9:40pm On Mar 27, 2007

I would retract that sentence, after studying ways to pass request front and back to the server it might be argued that banks could securely use HTTPS as a protocol in requesting an encrypted object from the web-tier.

Although, I am not fully convinced, but reading some article on recent HTTPS technology and the new 128-bits Cipher Strength, it could be argued that sending data across the internet gateway may pose little or no security issues.

But I am still heavily not convinced.
Programming / Re: Java Programming For Dummies by sbucareer(f): 8:47pm On Mar 27, 2007

Windows platform

SEt Path to

JAVA_HOME=C:\Program Files\Java\jdk1.6.0
CATALINA_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0

PATH=%PATH%;%JAVA_HOME%\bin;%CATALINA_HOME%\bin

Unix

Edit your .profile and add

JAVA_HOME=$PATH:~/bin:./Java/jdk1.6.0/bin
CATALINA_HOME=$PATH:~/bin:./Apache Software Foundation/Tomcat 6.0/bin
PATH=$PATH:$JAVA_HOME:$CATALINA
export PATH


Refer to this thread to get a picture settings.
Programming / Re: Article: Why A Career In Computer Programming Sucks by sbucareer(f): 8:08pm On Mar 27, 2007

andre5, I am sorry to hear your story. The problem to my recommendation to you now would base on your location in the globe. I believe you have come a long way with the amount of distrust you have for your present employer. I would be assessing you to a level of computer programme architect. The frustration now is that you are none of it.

Believe me andre5, IT professionals NEVER stay in one job for long unless the pay and benefits is attractive. You have stayed too long. Their behaviour shows it all. Like IBM, I did my placement with them for 9 months, it was incredible to find out that every month they hire new faces and I was wondering where all the other staff went?

I realize that they come build experience with company name and off they go to bigger thing with IBM in their resume. I was very mistaken to entertain the idea of building my career there.

andre5, you need to move on with a better package, meet new people and learn something new, not just programming. While in your job do other course like Information Management, wireless technology or data communication. There is lot of courses you can do at MSc level as part time.

You can study online with university like Open University or do certifications like Security auditing, Software testing etc. If you are generally feed up with IT, do MBA while working at your current job and come back after a year and become their business strategist or something.

My recommendation is, with your vast knowledge and skills coupled with number of years in IT; you should consider Investment Banking and Stock Trading companies. Learn to trade using sophisticated platforms, since you are an IT, it would be easy for you to digest their complex interface. I don't know how many investments banking in Nigeria, belong to happening banks like CBN. Set targets and work hard those people working there have not got two heads.

It would be very wrong to throw away years of experience and skills just because you do not like your job again. There is a way round. If your company offers a career break, take one not just 3-4 months. Take 1-2 year’s career break. Come back with a fresh mind set and maybe move on and hand in your resignation.

With your skills you can emigrate to Canada, they are welcoming people like you. Once you pass their assessment, which is education, work experience, age, Language Ability, they would give you Visa guaranteed. But it may cost you like $2500 from agaencies like this

Whatever you do girl don't forget your skill set that you have built for years that might be your only way to Eldora do. Good luck and do not relent.
Computers / Re: Oracle Database In Nigeria by sbucareer(f): 1:32pm On Mar 27, 2007

Another important and essential aspect of grid computing is the management of large clusters of service(Which you already know)  to meet applications' scalability and system reliability, availability and serviceability (RAS) requirements.

Next-generation systems will have similar or more stringent RAS requirements, but the difficulty and cost of managing these clustered systems will be compounded by ever-increasing platform and application complexity and cluster sizes. To ensure high performance and availability and to help lower total cost of ownership (TCO), these systems will require

1. Resource Visualization
2. Dynamic resource provisioning

These requirements are to meet the process of pulling in or out resources through out the infrastructure without any major issues. It is amazing how Oracle came up with this technology. These technologies will see them through at least another say 10 years.

1. Listen to this oracle broadcast
Computers / Re: Oracle Database In Nigeria by sbucareer(f): 1:00pm On Mar 27, 2007

As Oracle is definitely the big player in today's database application development with huge market cap, don't forget IBM DB2 and SEQUEL from Microsoft corp. For me the only thing that makes Oracle today's giant in database world is the ability to integrate Oracle 10g with tools like

1. Oracle fusion
2. Grid Computing
3. Object database
4. Oracle XML DB
5. Oracle Middleware
6. Extensions and Plug-ins
7. Oracle XML Publisher

They even went further to integrate Oracle 10g with .NET, Java, PHP and Service-Oriented Architecture. You do not need to buy an application server like J2EE and buy Oracle database. All is integrated with middleware that allows you to configure any other integration tool.

The Oracle fusion is a powerful tool and integration software. It allows you to achieve beyond imaginable.

This trend I believe will not last long as companies like Microsoft and IBM are not sleeping. But for now enjoy the job opportunities oracle offers. Also remember what someone said about IT role in the global market

Reference

1. Oracle site
Programming / Re: Java Programming For Dummies by sbucareer(f): 11:56am On Mar 27, 2007
[size=14pt]
Ok, sorry I will increase the ones on this thread and any other post I see your recommendation to increase the font. All my future post from now will be on a large font. Sorry for an inconvenience caused.
[/size]
Programming / Re: Why Nigerian Software Firms Are Absent On The Global Map by sbucareer(f): 9:50am On Mar 27, 2007
seun:
If an industry cannot survive without government assistance, then it does not deserve to exist.

I do not entirely agree with you Seun from such an intellectual mind like you. Businesses and corporations should sometime in their life require the assistance of government. It could be in the form of

1. Tax relieve
2. Wind fall
3. Cooperate tax cuts
4. Trade fair (Like office of the fair trade) to avoid monopoly from big and huge cap companies

The first five years of any new company faces a very difficult time. It could be either to pay back their loans and shareholder or to make profit and remain competitive.

In the West, government plays an important role in helping large and small-scale business to grow profitable. If they do, the government will benefit at a longer run.

Company like London Underground was give £30B last year to help with running of the company. Cadbury last year ran into problems with a Nigerian accountant (I don't really know what happened) and government stepped in to help thousands of employees who faces redundant and layoffs.

I don't need to tell you about Enron. NHS (National Health Service) is in a deficit of billions and government is trying to write it off. These are the sorts of things government should help the company, particularly the poor staff at the lower food chain working for the firm.

Later, you would start to complain that Nigerians are Yahoo boys when government cannot help to keep unemployment low.
Webmasters / Re: Seun, What Ur Site Server Language by sbucareer(f): 9:25pm On Mar 26, 2007

Also read this and apache
Programming / Re: Firebird Or Oracle by sbucareer(f): 9:13pm On Mar 26, 2007

I like open source programs and software’s; at least it helped me during my learning and development stages to becoming an IT professional. Now that I work for top IT firm and have developed serious critical application system, I tend to stay away from open source.

My reasons may not necessary be securities and applicability or even interoperability but the share robustness you get from working with a fully fledge licenced software and all the support you get if things goes wrong.

The best database on earth today MUST be oracle with market cap of 94.52B. P/E(Profit/Earning), no wonders why they have passed Microsoft. I do not like to use the word insecure but that must be the problems of open source.

Open source licence and companies are making serious revenue these days with market cap running into millions, no wonder their software are very difficult to configure employing you to call them to help in what would have been an easy configuration tool.

I rest my case as an analyst; spiral methods to debates do not always go my way as many people will find my approach to IT malevolence.
Programming / Re: Why Nigerian Software Firms Are Absent On The Global Map by sbucareer(f): 8:48pm On Mar 26, 2007

DJNiyi:
Some of us believe they are in the 3rd world and that's fine for them. However, some of us like to think we are not in a "3rd world" and we see ourselves as intellectual equals with our colleagues all around the world. The whole "3rd world" colo mentality is an anachronism anyway.

Please next time do not use the word 3rd world. It is an insult to developing countries like Africa. There is no such thing as 1st world, 2nd world, and 3rd world. The world was created at the same time. The first civilizations know to man today was developed by Africans. The ancient Africans developed the first spoken and written language. Africans first conceived the study of astronomy and stars. Time was originated in Africa. Before the Europeans appeared on the surface of earth there was a culture and civilization called Africans.

So please don't ever refer to Africa as third world. We are in fact the first world. The problem of Africa today is colonization or should I say assimilation and the better phase of slavery. When Africa had their power according to the bible we enslaved them too but we did not treat them the way they treated us.

The West is super power today and rich because of the sweat of our forefathers we sold into slavery. Britain has recognized the impact of slavery and are offering apologies and looking for ways to amend relationship with the Africans although their possessive ego will still be their primary interest.

Next time, please refer to Africa or others as a developing country not a 3rd world. Many African Professors would be appalled and upset if you ever use that word to them. Martin Luther King did not die for me to be called 3rd world.
Programming / Re: Do Nigerian Banks Have An Api To Their Database. by sbucareer(f): 8:11pm On Mar 26, 2007

Simple, get a SMS gateway from many of the online SMS services like this one

You really have to shop around, some offers low credit according to traffic and some offer just bulk buy. What ever you business application, you have to get an SMS gateway before you can develop an SMS portal.

Also your decision to getting a gatway from any company will be heavily dependent on the script language their offer as their API. Many offers Visual basic/ASP and PHP or JAVA.

They would send you a booklet or ebook on how to configure their API with your server. At this point if you need help contact me I would generously help you.

Other way is to set up your own SMS gateway, you would need some software like unix and get an ISP that has a GSM gateway that can terminate your messages. It could be two-way termination but it could cost you more.


I have a business proposal for someone that can introduce me to any top official that works with MTN or globalcom. The business is to provide me a carrier band to shift calls from the world to Nigeria at a very competitive rate. Your part would be a one off payment of £50k

sbucareer:
Banks would not be stupid to publish their API on the internet. Even by mistake you had come across such API, to access some object and call up a function say transfer balance etc, that process MUST be a local process known to the Enterprise Application.
NOTE segebee

I never said that bank do not have API. I said, it may not be available to the public.

Programming / Re: Do Nigerian Banks Have An Api To Their Database. by sbucareer(f): 7:14pm On Mar 26, 2007

There may be two types of API:

1. Local API
2. Remote API

Both API's are define during the application development stage. Bank being a very regulated service and security being one of the major business will NEVER publish their API as a remote web-service or remote-RPC/RMI.

Even if they do, it would be to a trusted party or a corelation of integrated solution from banks i.e. you can withdraw money from any bank that is not your branch.

I learned that the ATM machine in your bank or any banks do not in any way connect to your bank, amazing. You see the magnetic strip at the back of your credit card or bank card is just an EPROM (Erasable Programmable Read-Only Memory) that the machine uses to locate your tuple at the actual bank database.

The ATM is a computer like this one you are using to read this message. It is connected to internet through a special gateways. There is a software that runs within the box. The software reads your card and take and update your EPROM. Your EPROM is just a set credit or debit say $5000 limit

Any time you make withdrawal say $200, the software will do 5000 -200 = 4800 and the EPROM will be updated to $4800. The box will try and connect to the bank with these transactions using your bank account as the primary key. Meanwhile, you must have a $5000 credit/debit on your bank for the process to be successful.

This is when a remote API is used within a banking system. These API's are application dependent and cannot be changed or modified by any application. They use a very strong encryption to identify the remote object.

The point is you cannot have access to these API's, even if you do, the ATM have a Time stamp to every object that connects back to the bank.

Here is a definition of API from [url=http://www.google.com/search?hl=en&q=define%3A+API]google[/url]

5 Likes

Jokes Etc / Re: 5 Questions Most Feared By Men by sbucareer(f): 10:17am On Mar 26, 2007

Keep her busy you would not have time to all these question and answers. Besides what are you doing at home to be asked these questions?

Go and work and provide money for her to go to gym or something else to do. Low esteem girls/women ask such pitiful questions.

Off course once you get married both men/women definitely tend to put on weight. It is more sided to the women because their bear child(ren) and spend some considerable amount to their lives at home, bring up these children (Your children).

About men, there is no excuse to get fat. Those lazy ones that sits in front of TV and watch football and etc and drink bear and do little activity, the next thing you see, they jump into their car and off to work and sit in front of computer and chat to another girls on the internet and do little work. After work they are off to the pub and drink more bear and say something in the line that heaven and earth is on earth.

That if you have money, you are in heaven and if your poor you are in hell, that the curse of women (their wife) problem is that they eat to much and sit at home and do nothing. What a sad man talk.

Listen, our women are gold and our treasure and we would appreciate them. You will never know the powers of a women till you get married. They have their own powers and independent thoughts. That is why our country is not moving forward, because we only see them as strumpet.

Finally, if you want to be happily married (African men) respect your wife and treat her as you would be treated. Fat, XFat, big, XBig, they are all beautiful. If a nice man pick her up and look after her nicely (You longer troth) will be there, oleshi!
Webmasters / Re: How Are Web Pages Linked Together? by sbucareer(f): 9:46am On Mar 25, 2007

Other examples of linking

1. <a href="ambient.mp3">download the song (2.6MB mp3)</a> For file download
2. <a href="mailto:sbucareer@nairaland.com">mail me</a> For Email link
3. <EMBED SRC="graphics/sounds/movie.mid" HEIGHT=60 WIDTH=144 AUTOSTART=true STARTTIME="00:11" ENDTIME="00:16"> For embedding music or movies file.

Politics / Re: Nigerian NGOs Are Thieves! by sbucareer(f): 9:10am On Mar 25, 2007

Please ooo!!! What is NGO? I cannot follow the story very well because all the abbreviated words are alien to me, not just NGO.
Computers / Re: Router Configuration by sbucareer(f): 10:23pm On Mar 24, 2007

Now that data above could be in form of a binary using 32-bits i.e.

10010011101110001100110011110001

To learn more about binary visit [url=http://www.math.grinnell.edu/~rebelsky/Courses/CS152/97F/Readings/student-binary.html]binary[/url]

Binary are grouped into 4-bits i.e
1001 0011 1011 1000 1100 1100 1111 0001

But morden computers now uses 36-bits word-lenght.


Therefore to represent I for example could be 1001110000001111

I will finish this later I need to go now
Computers / Re: Router Configuration by sbucareer(f): 9:26pm On Mar 24, 2007

@uzomaeze

A router is a computer networking device that buffers and forwards data packets across an internetwork toward their destinations, through a process known as routing. Routing occurs at layer 3 (the Network layer e.g. IP) of the OSI seven-layer protocol stack.

In other words, OSI is like a process to get from the village to Lagos city. First you must be able to talk (communication) so people can understand you. You must have money to buy bus ticket. You must also have your destination address with you. You have to know your village address incase you need to return back because of problems i.e buses are on strike etc.

You must be able to read street numbers to locate you final destination. These process is called travelling (Routing) the vehicle (Router) is called bus. The bus (Router) is a very complex device like cars, the need petrol and service. Router needs configuration and repairs.

If you tell the bus to drop you to Abuja (Boarding the wrong bus), hence configuring the Router falsely it will not deliver your packets (Passengers in a bus).

I hope you understand this. The IEEE, which are the engineers that invent and define rules that govern electrical device came up with protocols. Protocols like it English meaning is communication in meaning.

Therefore, protocols for Router to communicate with another Router (Remember Router talks to only Router) is to use IP address which are unique in nature. These protocols are defined in the 7 OSI layer.

The first layer is binary signals i.e. one's and zero's.

These one's and zero's have amplitude, voltage and other electrical measures to differentiate one's from another one's. The Router must detect the amplitude and voltage of every binary and convert it back to the original word (decrypting) through the 7 OSI layer.

Like our analysis above, you MUST have a destination address and original address and body of message. In computer it is called package and the network card NIC split it into what is called frames and send it as a binary electrical signal over the copper wire as current.

Remember, there are current and when meet with another current it boost it power hence solving the attenuation problem. Older system uses repeater to solve this issue.

Let me give you and electrical example of how it really works.

Let say you want to send a letter to your girlfriend at Lagos and you live in Abuja. The content of the letter is:

I Love You.

You address is: 23 old road, Abuja
You girl's address is 1 Ikeja Road, Lagos

Now, Lagos originating telephone prefix number is 01 and Abuja, let say is 02.

Lets change your address and your girl address to digital

Yours: 23. 134. 2
Your girl's: 11.2.30

So, in telecommunication world to get to your telephone line at home would be

You: 01.23.134.2
Your girl: 02.11.2.30

Lets make a rule that each package would not exceed 20 bytes of data, thus we have the attached picture

Computers / Re: Running Two Operating Systems On One PC by sbucareer(f): 9:12pm On Mar 24, 2007

Partition your hard drive into two or three different entities using fdisk command from Windows or using Partition Manager if you have one.

Make sure you install windows first, starting from their oldest version i.e. 95, 95SE, 95ME, 2000, XP, 2003 and Vista. If you install the older version and pop in a new version it will offer you to upgrade or clean installation, choose clean installation. During the process choose the partition to use and making note of the partition

Finally, install any Unix file system by choosing the partition other than the current installed on. Although some unix file system will tell you which file system is already in use but don't count on it.

You can choose to boot from a floppy or create a boot record on the file system, which either one you chose will potentially depends on your installation process.

Warning, you must be familiar with Windows file systems i.e. FAT/FAT32, NTFS and WinFS etc to understand which partition the boot record should be.

If you are going to install any 64-bits operating system particularly with windows, use WinFS filing System. It is the new generation filing system.

If you also plan to install 64-bits UNIX operating system use the new revised UFS system  or FFS.

Culture / Re: Would You Marry An Osu? by sbucareer(f): 10:54am On Mar 24, 2007

I thought people interested in this topic might like to read this article
Business / Re: Calling Positive Minded Nigerians: by sbucareer(f): 1:26pm On Mar 23, 2007

Longesson, thank your for that initiative. That shows some of us are really thinking ahead with Nigerian in mind NOT just chicken and chips. I live in London as well and would really like to meet up with you.

I have very interesting ideas and business modules, most of the people I have contacted are very much interested in their mortgage and other personal affiliations or wants to buy the business module off me.

I have Nigeria at the top of my business focus and the possibility for relocation. My areas of interests are farming and IT with particular emphasis on grouping Nigeria small businesses (Group companies) to provide an investment funds (cap) that could be used to finance big cooperate businesses and further using pension funds from the cooperation to initiate long life Investment and property management.

You can contact me through [email=valentine.obih@gmail.com?subject=Calling Positive Minded Nigerians]email[/email].
Programming / Re: JSP Web Development by sbucareer(f): 12:38pm On Mar 23, 2007

Hmm,  You are leaving me again to solve your problems for you? The beauty of programming is NOT in writing the code but in DEBUGGING. Have you ever wondered why programmers or developers stay late at work? And, why software project is always late?

I can see your problem, but I am not telling. Try and debug it and look for answers. Use the debugger option in your javac, use the option -g i.e.

c:\>javac -g InterestRate.java


You look at this line yourself very carefully and tell me if you see a problem?

<td><b><jsp:getProperty name="pizza" property="hawaiia" v/></b></td></tr>

Programming / Re: JSP Web Development by sbucareer(f): 2:30am On Mar 23, 2007

Bossman, thanks. I wanted to introduce them to bean and servlet and how to compile a simple java. Package in Java is a hierarchal place holder java components should go according to individual.

Le say I am developing a timesheet web application for and organization called ubuntuBiz, I would try and organize my classes into logical location. So let say we have a web application folder under %CATALINA_HOME%\webapps called ubuntuBiz, then I will have the following folders

1. ubuntuBiz\WEB-INF\web.xml
2. ubuntuBiz\WEB-INF\classes\com\ubuntuBiz\beans
3. ubuntuBiz\WEB-INF\classes\com\ubuntuBiz\servlets
4.ubuntuBiz\WEB-INF\classes\com\ubuntuBiz\dao
5. ubuntuBiz\WEB-INF\classes\com\ubuntuBiz\utilities
6. ubuntuBiz\WEB-INF\lib
7. ubuntuBiz\jsp
8. ubuntuBiz\images
9. ubuntuBiz\index.jsp

Now, if was was to code a servlet class, I will put it under the ubuntuBiz\WEB-INF\classes\com\ubuntuBiz\servlets directory. If I was to create bean class, I will put it under the ubuntuBiz\WEB-INF\classes\com\ubuntuBiz\beans directory and etc.

Also, in the class of servlet class definition I MUST dd this signature


package com.ubuntuBiz.beans; //For beans classes

import java.sql.*;
public class UbuntubBizBean{

,
}//End


Finally, in the application web.xml I will do this

<web-app>
,
,

<servlet-class>com.ubuntuBiz.bean.UbuntuBean</servlet-class>

,
,
</web-app>
Programming / Re: JSP Web Development by sbucareer(f): 3:14pm On Mar 22, 2007


The following web.xml should be saved in ROOT\WEB-INF\web.xml and make sure your InterestRate.class is in ROOT\WEB-INF\class\InterestRate.class
and access the servlet like this

http://87.194.38.96/engine.exe


<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"wink; you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
    version="2.5">

  <display-name>Welcome to Tomcat</display-name>
  <description>
     Welcome to Interest rate calculation web application
  </description>

     <servlet>
    <servlet-name>interest</servlet-name>
    <servlet-class>InterestRate</servlet-class>
     </servlet>

     <servlet-mapping>
  <servlet-name>interest</servlet-name>
        <url-pattern>/engine.exe</url-pattern>
     </servlet-mapping>


     <error-page>
<error-code>500</error-code>
<location>/errorPage.jsp</location>
     </error-page>

</web-app>
Programming / Re: JSP Web Development by sbucareer(f): 2:55pm On Mar 22, 2007

Let learn how to bloody code web.xml since apache said that invoker is evil

Normally web application is a single entity collection of jsp, html, servlet, beans, classes, jpeg etc. Let say we want to create a school application. We will create a folder under webapps called school under school web app we will have the following folder and file

1. WEB-INF\classes (Mandatory)
2. WEB-INF\lib (Optional)
3. WEB-INF\web.xml (Mandatory if your are going to use servlet under Tomcat 6.0)
4. images (Optional)


ROOT is the default web application  apache added into all Tomcat. There is no reason why we should continue using it. Infact we can change our webapps directory to another cluster or filepath by modifying server.xml in the conf directory

<Host name="localhost"  appBase="webapps"
           unpackWARs="true" autoDeploy="true"
           xmlValidation="false" xmlNamespaceAware="false">

Infact you can create a directory called interestRate and make sure it has all these directories and file(s)

1. WEB-INF\classes (Mandatory)
2. WEB-INF\lib (Optional)
3. WEB-INF\web.xml (Mandatory if your are going to use servlet under Tomcat 6.0)
4. images (Optional)

How you access it from the URL is http://localhost/engine.exe if you are using port 8080 etc. http://localhost:8080/engine.exe. If your listing directory is not switched off from the server.xml, you will see all the directories in your web app apart from WEB-INF. You can NEVER see that folder Tomcat's security measures that is why your web.xml file is there and you classes directory and lib (library) directory.

Now this is how we code web.xml.

Programming / Re: JSP Web Development by sbucareer(f): 2:26pm On Mar 22, 2007

I have searched the net about InvokerServlet is privileged in my catalina.log in error log directory because I could not access my InterestRate.java class.

It happens that Tomcat 6.0 have made changes to the Invoker servlet. You need to explicitly define servlet in the web.xml to be able to access it. What I still do not understand is how to make a servlet a privileged file. Here is the forum I got some ideas from.

Sorry, people I do not want to introduce you to web.xml yet but the version of Tomcat we are using would not allow use to do servlet invoker. So comment out in your container web.xml under the this directory C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf  the mappings to Invokers

If you are using Tomcat 4.1, which is the last tomcat I used before this trail, you would be able to use the invoker.

Also see invoker is evil

In my opinion, they should drop invoker altogether

Programming / Re: JSP Web Development by sbucareer(f): 12:13pm On Mar 22, 2007

Meanwhile, Taysay the error free servlet of InterestRate.java is given bellow.

import java.text.*;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class InterestRate extends HttpServlet{



   private double loanAmount = 6400;
   private double interestRate = 40.9; //Too expensive
   private int numYears = 4;
   private DecimalFormat perc2;

    public void doGet( HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException{
       response.setContentType("text/html"wink;

        ServletOutputStream out = response.getOutputStream();
/*
        PrintWriter out = response.getWriter(); You can use either one. Both are the same Just that the ServletOutputStream is included in the Servlet API */



    out.println("<html>"wink;
    out.println("<head>"wink;
    out.println("<title>Loan calculation</title>"wink;
    out.println("</head>"wink;
    out.println("<body>"wink;
    out.println("<h2>Loan Calculation</h2>"wink;

    out.println("Loan Amount:"wink;
     out.println("<br/>"wink;
      out.println("Interest Rate:"wink;
      out.println("<br/>"wink;

     out.println("*****************************"wink;
     out.println("<br/>"wink;
     out.println("Number of years:"wink;
     out.println("<br/>"wink;
     out.println("Total interest:"wink;
     out.println(calculateInterest(loanAmount,interestRate,numYears));
     out.println("<br/>"wink;
     out.println("******************************"wink;
     out.println("<br/>"wink;
     out.println("Monthly repayments:"wink;
     out.println( loanRepayments(loanAmount,interestRate,numYears));
     out.println("<br/>"wink;

    //Change the value of years
     numYears++;

    out.println("*****************************"wink;
    out.println("<br/>"wink;
    out.println("Number of years:"wink;
    out.println("<br/>"wink;
     out.println("Total interest:"wink;

    out.println("<br/>"wink;

    out.println("******************************"wink;
    out.println("<br/>"wink;
    out.println("Monthly repayments:"wink;

     out.println("</body>"wink;
     out.println("</html>"wink;
     out.close();


}//End doGet

   public void doPost(HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException{
       doGet(request, response);
   }//End doPost


   public double calculateInterest(double loanAmount, double interestRate, int numYears ){
         
           return numYears * interestRate * loanAmount / 100;
   }//End calculateInterest

   public String loanRepayments( double loanAmount, double interestRate, int numYears){
           perc2 = new DecimalFormat("$#,##0.00;{$#,##0.00}"wink;
           return perc2.format(( calculateInterest(loanAmount,interestRate,numYears) + loanAmount )  / (numYears *12));
   }//End loanRepayments
}//End InterestRate class
Programming / Re: JSP Web Development by sbucareer(f): 12:10pm On Mar 22, 2007

Save this file as compile.bat under your C:\ drive

UPDATE your PATH to include your development directory my is (C:\Miscellaneous\nairaland) i.e.

PATH=;C:\Miscellaneous\nairaland


REM set this compile.bat to your PATH i.e. PATH=;C:\Miscellaneous\nairaland


cd\
REM productionDirectory. My is C:\Miscellaneous\nairaland

cd C:\Miscellaneous\nairaland\

javac -g *.java

mov *.class c:\program files\Apache Software Foundation\Tomcat 6.0\webapps\ROOT\WEB-INF\classes


Type compile from your command line interface that will compile your java file from your production directory and put the class file to the container %CATALINA_HOME%\webapps\ROOT\WEB-INF\classes

If all goes well you can access your servlet from http://localhost/servlet/InterestRate

I have issues with my own. The error message was in my catalina.log, it say

22-Mar-2007 10:28:03 org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory docs
java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.InvokerServlet is privileged and cannot be loaded by this web application
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1134)

I think the problem is that the new version of Tomcat would not allow you to run servlet under the ROOT context because of security issues. I will find a way to sort that and I will post the solutions.
Programming / Re: JSP Web Development by sbucareer(f): 10:29am On Mar 22, 2007

Taysay, for a start the servlet class would not compile. Why? You have not yet included the methods. i.e.

1. calculateInterest ()
2. loanRepayment()

Remember that your servlet is a java class file. Every methods(function as they call it in c/c++) used MUST be declared and coded if possible. Therefore your code would look like this



import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.ServletResponse;
import javax.servlet.*;
import java.io.*;
import java.util.*;

public class InterestRate extends HttpServlet{



  private double loanAmount = 6400;
  private double interestRate = 40.9; //Too expensive
  private int numYears = 4;
  private DecimalFormat perc2;

    public void doGet( HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException{
      response.setContentType("text/html"wink;

       PrintWriter out = response.getWriter();

    out.println("<html>"wink;
    out.println("<head>"wink;
    out.println("<title>Loan calculation</title>"wink;
    out.println("</head>"wink;
    out.println("<body>"wink;
    out.println("<h2>Loan Calculation</h2>"wink;

    out.println("Loan Amount:"wink;
     out.println("<br/>"wink;
      out.println("Interest Rate:"wink;
      out.println("<br/>"wink;

     out.println("*****************************"wink;
     out.println("<br/>"wink;
     out.println("Number of years:"wink;
     out.println("<br/>"wink;
     out.println("Total interest:"wink;
     out.println(calculateInterest(loanAmount,interestRate,numYears));
     out.println("<br/>"wink;
     out.println("******************************"wink;
     out.println("<br/>"wink;
     out.println("Monthly repayments:"wink;
     out.println( loanRepayments(loanAmount,interestRate,numYears));
     out.println("<br/>"wink;

    //Change the value of years
     numYears++;

    out.println("*****************************"wink;
    out.println("<br/>"wink;
    out.println("Number of years:"wink;
    out.println("<br/>"wink;
     out.println("Total interest:"wink;

    out.println("<br/>"wink;

    out.println("******************************"wink;
    out.println("<br/>"wink;
    out.println("Monthly repayments:"wink;

     out.println("</body>"wink;
     out.println("</html>"wink;


}//End doGet

   public void doPost(HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException{
      doGet(request, response);
   }//End doPost


  public double calculateInterest(double loanAmount, double interestRate, int numYears ){
       
          return numYears * interestRate * loanAmount / 100;
  }//End calculateInterest

  public String loanRepayments( double loanAmount, double interestRate, int numYears){
          perc2 = new DecimalFormat("$#,##0.00;{$#,##0.00}"wink;
          return perc2.format(( calculateInterest(loanAmount,interestRate,numYears) + loan )  / (numYears *12));
  }//End loanRepayments
}//End InterestRate class


And your class name MUST start with Capital letter in java world.

Programming / Re: JSP Web Development by sbucareer(f): 8:45am On Mar 22, 2007

l think the Jdbc connection is literally straight forward. If you find any part difficult let us know.

Forget tomcat at the moment, open your ready to program and create tables, update, insert and delete records.
Programming / Re: JSP Web Development by sbucareer(f): 11:47pm On Mar 21, 2007

Let see a little javabean program that connects to our datasource


import java.sql.*;

public class PizzaBean {
private Connection con;
private Statement stmt;
private Resultset rs;

String datasourceName = "pizza";
String dbURL = "jdbc:odbc:" + dataSourceName;

public PizzaBean(){
   try{
//load the database driver and instantiate it
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"wink.newInstance();
       con =  DriverManager.getConnection( dbURL, "", ""wink;
   }catch(Exception e){
          e.getMessage();
  }//End constructor

public Connection getConnection(){
   return con;
}//End get|Connection

public void createTable (String tableName){
 
     String query = "Create Table"+ tableName + "(name varchar(15)"+
                                                                      "address varchar(20),"+
                                                                      "purchaseType varchar(6),"+
                                                                      "margherita varchar(5),"+
                                                                      "hawaiian varchar(5),"+
                                                                      "pepperoni varchar(5));";
     try{
               if (getConnection == null)
                       this.getConnection;

               stmt = con.createStatement()
               rs = stmt.executeQuery(query);
     }catch(Exception e){
          e.getMessage();
     }

  //You can add more methods to suit you

}//End of PizzaBean class
         
Programming / Re: JSP Web Development by sbucareer(f): 11:16pm On Mar 21, 2007

Create a datasource and put it in a directory. Remember the datasource name as this is how we will refer to it in our java file. I have given this datasource name as pizza.

Datasource is the actuall file system name of your database records.

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (of 38 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 117
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.