Servlet with dopost and main() methods
I have pre-existing servlet code for maintenance purposes.
It received a request by POST action from the client. This class also has main() method where class is instasiated and processed.
Can anyone help me understand reason for having dopost and main() methods.
TIA
Before the days of JUnit developers would write a main method for a class as a way to test the class. Some older developers still do it. I know because I am dealing with the problem now.
Similar Messages
-
How to print a string with out using main method??
how to print a string with out using main method??
if we can tell me with example?
thanks in adavance
rajaHi,
actually there's none. The UITableView class needs to "know" the tableView's height so either it can calc <number of rows> times <row height> or it has to sum the height of each single row.
If the row which needs to be of different size always is the first or the last row you can user a tableHeader or tableFoot view.
Regards
Dirk -
Deploying an rich client (Applet and main method)in iPlanet.
I would like to know how to deploy an applet client and a main() method client in the iPlanet Application Server. Adv. thnax for your replies.
Dear punit,
Thanx for ur reply.
but then where will i mention the JNDI name which we usually supply in DD during the deployment of a WAR file.
When i try to run the standalone appln. i get an error, because i have not supplied a jndi name in the server. where will client find out the jndi name from, because nothing is specified in the server(but in the case of servlet we spcify the JNDI name in DD XML file.)
R u working currently on iAS6.0.
Thanx and see if u can reply me ASAP. -
Please Let Me know If service(), doPost() and doGet() are Thread-safe. If they are not thread safe, How to make them thread-safe?
Please Let Me know If service(), doPost() and doGet() are Thread-safe. They are not.
If they are not thread safe, How to make them thread-safe?The best way is to avoid writing code that depends on a servlet's thread safety; i.e., no servlet instance variables - keep everything local to the method. Else, you'll want to learn about synchronization.
[JavaWorld article - Write thread-safe servlets|http://www.javaworld.com/javaworld/jw-07-2004/jw-0712-threadsafe.html].
~ -
Abstract class with set and get methods
hi
how to write set and get methods(plain methods) in an abstartc class
ex: setUsername(String)
String getUsername()
and one class is extending this abstract class and same methods existing in that sub class also..... how to write......plz provide some ideas
am new to programming....
asap
thnx in advanceyes... as i told u.... i am new to coding......
and my problem is ..... i have 2 classes one is abstract class without abstract methods.. and another class is extending abstract class.....
in abstract class i have 2 methods...one is setusername(string) and getusername() ..... how to write these two methods.... in abstract class i have private variables username...... when user logins ..... i need to catch the user name and i need to validate with my oracle database and i need to identify the role of that user and based on role of that user i need to direct him to appropriate jsp page.......
for that now i am writing business process classes..... the above mentioned two classes are from business process.....
could u help me now
thnx in advance -
Packages and Main method.
What is the reason for the following. When you explicitly specify a package name for a class that contains the main method, why do you have to specify the fully qualified class name when you invoke the JVM?
For example:
package Exercises.Chp8.ExerciseTwo;
import Exercises.Chp8.Interfaces.*;
class Exercise2 implements myInterface {
public void method1() {
System.out.println("method 1 implemenmted");
public void method2() {
System.out.println("method 2 implemenmted");
public void method3() {
System.out.println("method 3 implemenmted");
public class testExercise2 {
public static void main(String[] args) {
Exercise2 ex = new Exercise2();
ex.method1();
ex.method2();
ex.method3();
I would have to issue the following command:
java Exercises.Chp8.ExerciseTwo.testExercise2
for the java to run. If I specify java testExercise2, it displays a stack trace of the classLoader and an error messages reads regarding "wrong name". Can someone explain why this is?Hi,
Please refer the following URL.
It is very well documented in the java site.
Please refer these URL's
http://java.sun.com/docs/books/tutorial/java/interpack/packages.html
http://java.sun.com/docs/books/tutorial/java/interpack/createpkgs.html
http://java.sun.com/docs/books/tutorial/java/interpack/usepkgs.html
http://java.sun.com/docs/books/tutorial/java/interpack/managingfiles.html
Also please refer this URL, which has a discussion about packages.
http://forum.java.sun.com/thread.jsp?forum=31&thread=151016
I hope this will help you.
Thanks
Bakrudeen -
DoPost() and doGet() method calling
Hi All,
What is the purpose of calling the doGet() method inside of doPost() instead of calling it directly.
doPost(HttpServletRequest request, HttpServletResponse response){
doGet(request,response);
why we are calling the doGet() method like thisThanks in Advance,
mahesSeemingly the post and the get do exactly the same thing, so to avoid duplicate code, (s)he just simply had one call the other.
However, you shouldn't really do it this way. You should break out the parts of the methods that are the same into new methods, and call these new methods from both the post and get methods. That will allow the two methods to handle some other things slightly differently. I.E. the get method is not suppossed to cause side effects (i.e. you are not suppossed to change any data when using a get method) whereas post methods can. -
Issue with createViewObjectOnEntity() and findByKey() methods.
Good day.
I have next entity object.
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE Entity SYSTEM "jbo_03_01.dtd">
<!---->
<Entity
xmlns="http://xmlns.oracle.com/bc4j"
Name="PpRegCardEO"
Version="11.1.1.56.60"
DBObjectType="table"
DBObjectName="PP_REG_CARD"
AliasName="PpRegCard"
BindingStyle="OracleName"
UseGlueCode="false"
RowClass="model.entity.PpRegCardEOImpl">
<DesignTime>
<Attr Name="_codeGenFlag2" Value="Access"/>
<AttrArray Name="_publishEvents"/>
<Attr Name="_isCodegen" Value="true"/>
</DesignTime>
<Attribute
Name="PpRegCardId"
IsNotNull="true"
ColumnName="PP_REG_CARD_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD"
PrimaryKey="true">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
<Properties>
<CustomProperties>
<Property
Name="SequenceName"
Value="SEQ_PP_REG_CARD_ID"/>
</CustomProperties>
</Properties>
</Attribute>
<Attribute
Name="TaxpayerId"
IsNotNull="true"
ColumnName="TAXPAYER_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
</Attribute>
<Attribute
Name="ParentTpRegCardId"
ColumnName="PARENT_TP_REG_CARD_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
</Attribute>
<Attribute
Name="RegistryCardNumber"
IsNotNull="true"
Precision="100"
ColumnName="REGISTRY_CARD_NUMBER"
SQLType="VARCHAR"
Type="java.lang.String"
ColumnType="VARCHAR2"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="100"/>
</DesignTime>
</Attribute>
<Attribute
Name="FirstnameDcId"
IsNotNull="true"
Precision="22"
Scale="0"
ColumnName="FIRSTNAME_DC_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
</Attribute>
<Attribute
Name="LastnameDcId"
IsNotNull="true"
Precision="22"
Scale="0"
ColumnName="LASTNAME_DC_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
</Attribute>
<Attribute
Name="PatronymicDcId"
Precision="22"
Scale="0"
ColumnName="PATRONYMIC_DC_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
</Attribute>
<Attribute
Name="Gender"
IsNotNull="true"
Precision="1"
ColumnName="GENDER"
SQLType="CHAR"
Type="java.lang.String"
ColumnType="CHAR"
TableName="PP_REG_CARD"
RetrievedOnUpdate="true"
RetrievedOnInsert="true">
<DesignTime>
<Attr Name="_DisplaySize" Value="1"/>
</DesignTime>
</Attribute>
<Attribute
Name="BirthdayDt"
IsNotNull="true"
ColumnName="BIRTHDAY_DT"
SQLType="TIMESTAMP"
Type="oracle.jbo.domain.Date"
ColumnType="DATE"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="7"/>
</DesignTime>
</Attribute>
<Attribute
Name="InvalidationDt"
ColumnName="INVALIDATION_DT"
SQLType="TIMESTAMP"
Type="oracle.jbo.domain.Date"
ColumnType="DATE"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="7"/>
</DesignTime>
</Attribute>
<Attribute
Name="PassportId"
IsNotNull="true"
Precision="22"
Scale="0"
ColumnName="PASSPORT_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
</Attribute>
<Attribute
Name="CitizenshipId"
IsNotNull="true"
Precision="22"
Scale="0"
ColumnName="CITIZENSHIP_DC_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
</Attribute>
<Attribute
Name="TravelPassportExistsFl"
IsNotNull="true"
Precision="1"
Scale="0"
ColumnName="TRAVEL_PASSPORT_EXISTS_FL"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
</Attribute>
<Attribute
Name="ActiveFl"
IsNotNull="true"
Precision="1"
Scale="0"
ColumnName="ACTIVE_FL"
SQLType="NUMERIC"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="22"/>
</DesignTime>
</Attribute>
<Attribute
Name="UpdatedBy"
Precision="64"
ColumnName="UPDATED_BY"
SQLType="VARCHAR"
Type="java.lang.String"
ColumnType="VARCHAR2"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="64"/>
</DesignTime>
</Attribute>
<Attribute
Name="UpdatedDt"
ColumnName="UPDATED_DT"
SQLType="TIMESTAMP"
Type="oracle.jbo.domain.Date"
ColumnType="DATE"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="7"/>
</DesignTime>
</Attribute>
<Attribute
Name="CreatedBy"
IsNotNull="true"
Precision="64"
ColumnName="CREATED_BY"
SQLType="VARCHAR"
Type="java.lang.String"
ColumnType="VARCHAR2"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="64"/>
</DesignTime>
</Attribute>
<Attribute
Name="CreatedDt"
IsNotNull="true"
ColumnName="CREATED_DT"
SQLType="TIMESTAMP"
Type="oracle.jbo.domain.Date"
ColumnType="DATE"
TableName="PP_REG_CARD">
<DesignTime>
<Attr Name="_DisplaySize" Value="7"/>
</DesignTime>
</Attribute>
<AccessorAttribute
Name="CitizenshipEO"
Association="model.entity.association.PpRgCrdCitizenshipFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdCitizenshipFkAssoc.CitizenshipEO"
AssociationOtherEnd="model.entity.association.PpRgCrdCitizenshipFkAssoc.PpRegCardEO"
Type="model.entity.common.BaseEntityImpl"
IsUpdateable="true"/>
<AccessorAttribute
Name="PpRegCardEO"
Association="model.entity.association.PpRgCrdParentRgCrdFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdParentRgCrdFkAssoc.PpRegCardEO"
AssociationOtherEnd="model.entity.association.PpRgCrdParentRgCrdFkAssoc.ParentTpRegCardIdPpRegCardEO"
Type="oracle.jbo.RowIterator"
IsUpdateable="false"/>
<AccessorAttribute
Name="ParentTpRegCardIdPpRegCardEO"
Association="model.entity.association.PpRgCrdParentRgCrdFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdParentRgCrdFkAssoc.ParentTpRegCardIdPpRegCardEO"
AssociationOtherEnd=model.entity.association.PpRgCrdParentRgCrdFkAssoc.PpRegCardEO"
Type="model.entity.PpRegCardEOImpl"
IsUpdateable="true"/>
<AccessorAttribute
Name="PpRegCardCorrespondentEO"
Association="model.entity.association.PpRgCrdCrrspndRegCardFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdCrrspndRegCardFkAssoc.PpRegCardCorrespondentEO"
AssociationOtherEnd="model.entity.association.PpRgCrdCrrspndRegCardFkAssoc.PpRegCardEO"
Type="oracle.jbo.RowIterator"
IsUpdateable="false"/>
<AccessorAttribute
Name="CitizenshipEO1"
Association="model.entity.association.PpRgCrdCitizenshipIdFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdCitizenshipIdFkAssoc.CitizenshipEO1"
AssociationOtherEnd="model.entity.association.PpRgCrdCitizenshipIdFkAssoc.PpRegCardEO1"
Type="model.entity.CitizenshipEOImpl"
IsUpdateable="true"/>
<AccessorAttribute
Name="PhysPersonPassportEO1"
Association="model.entity.association.PpRgCrdPassportIdFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdPassportIdFkAssoc.PhysPersonPassportEO1"
AssociationOtherEnd="model.entity.association.PpRgCrdPassportIdFkAssoc.PpRegCardEO1"
Type="model.entity.PhysPersonPassportEOImpl"
IsUpdateable="true"/>
<AccessorAttribute
Name="LastnameDcEO"
Association="model.entity.association.PpRgCrdLastNameFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdLastNameFkAssoc.LastnameDcEO"
AssociationOtherEnd="model.entity.association.PpRgCrdLastNameFkAssoc.PpRegCardEO"
Type="model.entity.LastnameDcEOImpl"
IsUpdateable="true"/>
<AccessorAttribute
Name="FirstnameDcEO"
Association="model.entity.association.PpRgCrdFirsNameFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdFirsNameFkAssoc.FirstnameDcEO"
AssociationOtherEnd="model.entity.association.PpRgCrdFirsNameFkAssoc.PpRegCardEO"
Type="model.entity.FirstnameDcEOImpl"
IsUpdateable="true"/>
<AccessorAttribute
Name="TaxPayerEO"
Association="model.entity.association.PpRgCrdTaxPayerFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdTaxPayerFkAssoc.TaxPayerEO"
AssociationOtherEnd="model.entity.association.PpRgCrdTaxPayerFkAssoc.PpRegCardEO"
Type="model.entity.TaxPayerEOImpl"
IsUpdateable="true"/>
<AccessorAttribute
Name="PatronymicDcEO"
Association="model.entity.association.PpRgCrdPatroymicFkAssoc"
AssociationEnd="model.entity.association.PpRgCrdPatroymicFkAssoc.PatronymicDcEO"
AssociationOtherEnd="model.entity.association.PpRgCrdPatroymicFkAssoc.PpRegCardEO"
Type="model.entity.PatronymicDcEOImpl"
IsUpdateable="true"/>
<AccessorAttribute
Name="PpRegCardChangeCauseEO"
Association="model.entity.association.PrePpRcrdFkAssoc"
AssociationEnd="model.entity.association.PrePpRcrdFkAssoc.PpRegCardChangeCauseEO"
AssociationOtherEnd="model.entity.association.PrePpRcrdFkAssoc.PpRegCardEO"
Type="oracle.jbo.RowIterator"
IsUpdateable="false"/>
<AccessorAttribute
Name="PpPrintedRegCardEO"
Association="model.entity.association.PpPrntRcPpRcrdFkAssoc"
AssociationEnd="model.entity.association.PpPrntRcPpRcrdFkAssoc.PpPrintedRegCardEO"
AssociationOtherEnd="model.entity.association.PpPrntRcPpRcrdFkAssoc.PpRegCard"
Type="oracle.jbo.RowIterator"
IsUpdateable="false"/>
<Key
Name="Avcon1286373792Sex000">
<DesignTime>
<Attr Name="_DBObjectName" Value="AVCON_1286373792_SEX_000"/>
<Attr Name="_checkCondition" Value="SEX IN ('M', 'F')"/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="PpRegCardCitizenshipDcIdCheck">
<DesignTime>
<Attr Name="_isNotNull" Value="true"/>
<Attr Name="_DBObjectName" Value="PP_REG_CARD_CITIZENSHIP_DC_ID_"/>
<Attr Name="_checkCondition" Value='"CITIZENSHIP_DC_ID" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes">
<Item Value="model.entity.PpRegCardEO.CitizenshipId"/>
</AttrArray>
</Key>
<Key
Name="PpRegCardPk"
PrimaryKey="true">
<DesignTime>
<Attr Name="_DBObjectName" Value="PP_REG_CARD_PK"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013571">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013571"/>
<Attr Name="_checkCondition" Value='"PP_REG_CARD_ID" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013573">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013573"/>
<Attr Name="_checkCondition" Value='"TAXPAYER_IN_SID" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013574">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013574"/>
<Attr Name="_checkCondition" Value='"REGISTRY_CARD_NUMBER" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013575">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013575"/>
<Attr Name="_checkCondition" Value='"LASTNAME" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013576">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013576"/>
<Attr Name="_checkCondition" Value='"FIRSTNAME" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013577">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013577"/>
<Attr Name="_checkCondition" Value='"SEX" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013578">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013578"/>
<Attr Name="_checkCondition" Value='"BIRTHDAY_DT" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013579">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013579"/>
<Attr Name="_checkCondition" Value='"BIRTH_ADR_ID" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013580">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013580"/>
<Attr Name="_checkCondition" Value='"PASSPORT_ID" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013581">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013581"/>
<Attr Name="_checkCondition" Value='"CITIZENSHIP_ID" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013582">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013582"/>
<Attr Name="_checkCondition" Value='"ACTIVE_FL" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013583">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013583"/>
<Attr Name="_checkCondition" Value='"CREATED_BY" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="SysC0013584">
<DesignTime>
<Attr Name="_DBObjectName" Value="SYS_C0013584"/>
<Attr Name="_checkCondition" Value='"CREATED_DT" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="uk_PpRegCardEO">
<DesignTime>
<Attr Name="_isUnique" Value="true"/>
<Attr Name="_isNotNull" Value="true"/>
<Attr Name="_DBObjectName" Value="UK_PP_REG_CARD_EO"/>
</DesignTime>
<AttrArray Name="Attributes">
<Item Value="model.entity.PpRegCardEO.PpRegCardId"/>
</AttrArray>
</Key>
<Key
Name="PpRgCrdBirthAdrIdFk">
<DesignTime>
<Attr Name="_referencedKey" Value="ADDRESS_TREE_PK"/>
<Attr Name="_isForeign" Value="true"/>
<Attr Name="_DBObjectName" Value="PP_RG_CRD_BIRTH_ADR_ID_FK"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="PpRgCrdCitizenshipIdFk">
<DesignTime>
<Attr Name="_referencedKey" Value="CITIZENSHIP_PK"/>
<Attr Name="_isForeign" Value="true"/>
<Attr Name="_DBObjectName" Value="PP_RG_CRD_CITIZENSHIP_ID_FK"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="PpRgCrdParentRgCrdFk">
<DesignTime>
<Attr Name="_referencedKey" Value="PP_REG_CARD_PK"/>
<Attr Name="_isForeign" Value="true"/>
<Attr Name="_DBObjectName" Value="PP_RG_CRD_PARENT_RG_CRD_FK"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<Key
Name="PpRgCrdPassportIdFk">
<DesignTime>
<Attr Name="_referencedKey" Value="PP_PASSPORT_PK"/>
<Attr Name="_isForeign" Value="true"/>
<Attr Name="_DBObjectName" Value="PP_RG_CRD_PASSPORT_ID_FK"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
<ResourceBundle>
<PropertiesBundle
PropertiesFile="model.RG-01Bundle"/>
</ResourceBundle>
</Entity>
In my application module I'm creating view object based on this entity object:
ViewObject regCardVO =
appModuleImpl.createViewObjectOnEntity("RegCardVO",
"model.entity.PpRegCardEO");
Then I want to find view object row by key.
Row[] foundRegCards = regCardVO.findByKey(new Key(new Object[] {new Number(1)}), 1);
But I have an exception: java.sql.SQLSyntaxErrorException: ORA-00904: "PPREGCARDEO"."PP_REG_CARD_ID": invalid identifier .
The reason of exception in wrong SQL query that ADF-BC generates for method findByKey. The query is next:
SELECT
PP_REG_CARD_ID "PpRegCardId",
TAXPAYER_ID "TaxpayerId",
PARENT_TP_REG_CARD_ID "ParentTpRegCardId",
REGISTRY_CARD_NUMBER "RegistryCardNumber",
FIRSTNAME_DC_ID "FirstnameDcId",
LASTNAME_DC_ID "LastnameDcId",
PATRONYMIC_DC_ID "PatronymicDcId",
GENDER "Gender", BIRTHDAY_DT "BirthdayDt",
INVALIDATION_DT "InvalidationDt",
PASSPORT_ID "PassportId",
CITIZENSHIP_DC_ID "CitizenshipId",
TRAVEL_PASSPORT_EXISTS_FL "TravelPassportExistsFl",
ACTIVE_FL "ActiveFl",
UPDATED_BY "UpdatedBy",
UPDATED_DT "UpdatedDt",
CREATED_BY "CreatedBy",
CREATED_DT "CreatedDt"
FROM PP_REG_CARD
WHERE (PpRegCardEO.PP_REG_CARD_ID = ?)
We can see that in 'FROM' section table specified without alias, but in 'WHERE' clause the 'PpRegCardEO' alias is used with column name.
That is the why I have an ORA-00904 error.
Can anyone tell me is it possible to fix this problem ?Hi,
I agree it's not expected, but I have no experience with this construction.
My first reaction is to avoid such constructions. One, because it's not very transparent. Two, because it's a waste of resources because the ViewObject has already been created. And third because it seems you have less control on the object. If you have no other option, maybe you could use createViewObjectFromQueryStmt.
However, it should be possible to bundle business components in an ADF library and import that one in the project that uses these BC's. This allows normal usage of these viewobjects in applicationmodules. I think this is the recommended approach.
Ciao
Aino -
SelectManyShuttle proxy usage with reset() and addItem() methods
I would like to pre-populate the trailing list of the shuttle with values that can change with a select one choice component. The leading list would be populated with another select one choice and these could be added to the existing values in the trailing list.
I am assuming I could do this by using a proxy
var proxy2 = new ShuttleProxy("testShuttle2", "testForm2");
and using the addItem() method for the trailing list. Then doing a reset() each time the select one choice component is changed.
I would just like to know if this is do-able and if there are any more detailed examples than can be found at
http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/selectManyShuttle.html
ThanksHi,
I think this all better comes from a single selection list that you build e.g. in a managed bean. Based on the selected value of the selectOnceChoice poplist, you can then pre-select elements from the list.
Note that using separate lists bears the problem of what to do when the user de-selects an item. How do you recover this?
Frank -
Web login (JSP, Servlet) with roles and users list stored using db4o
Dear all,
I would be grateful if someone of you (the masters out there) could help me with the build of an application where the first page will be a login page.
The users will be devided in 3 categories (user, editor, administrator) and there member information will be saved in db4o database.
If the user has not been registered in the past then a registration page should come up allowing him to be registered and keep his details in a db4o database on the same site.
I am using JSEE8 and the site will be sent to a Tomcat server on the net.
Please please please HELPI am giving some code for to redirect as the user is, But before that you have to made a extra coloumn "role" in your security table. and put admin, user as respective roles.
doPost(HttpReq...........)
String user = req.getParameter("UserName"):
String pass= req.getParameter("Password");
Then Connect the database with ur code ie class.forName etc
String sql= "Select * from security_table where Username= ' "+user+" ' and Password= ' "+pass+" ' ";
Statement stmt = conn.createStatement();
ResultSet rs= stmt.exequteQuary(sql);
if(rs.next)
String S1=rs.getString("Username");
String S2= rs.getString("Password");
String S3= rs.getString("Role");
if(S1.equals(user) && S2.equals(pass) && S3.equals.(admin)){
req.sendRedirect(http:// full path name of the page)
else if( S1.equals(user) && S2.equals(pass) && S3.equals.(user))
req.sendRedirect(http:// full path name of the page)
}else
req.sendRedirect(http:// full path name of the Error page)
} -
Problem with File and his methods
Is there a way to know how much Files there is in a File.
MyFile contain MySubFile1 MySubFile2 and what i want my program to do is to return the number 2 (for my two subfiles).File repracine = new File("namedir") ;
String[] tabfile ;
if (!repracine.exists())
repracine.mkdir() ;
tabfile = repracine.list() ;
for (int i=0;i<tabfile.length();i++)
System.out.println(tabfile) ;
problem: tabfile.length()...
Small changes have to be done..
1. length is not a method but an attribute of the array. That means that> for (int i=0;i<tabfile.length();i++) has to be for (int i=0;i<tabfile.length;i++)2. If you want just the number of files in your directory You don't need the for loop at all. All you need is the tabfile.length value. If you need to print the names of all the files in the directory then you better change line:> System.out.println(tabfile) ; to > System.out.println(tabfile) ;
Hope that helped.
afotoglidis -
Help with xmlListCollection and getItemAt method!
All,
I have a simple application in which I have a data grid, http sevice and xmllistcollection. I get the xml data and populate the xmllistcollection. Objective is to traverse the xmlcollection to get the first row, parse and set the column headers dynamically.
the first row in the xmllistcollection are the column headers. I am trying to get the values using the getItemAt(0) method, which does return a object but not sure how to traverse the object to draw the column headers for the data grid dynamically? below is the sample example
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.controls.dataGridClasses.DataGridColumn;
public function fetch():void
xmlRPC.send();
var i:int = 0;
var a:XMLList = new XMLList(xdata.getItemAt(0).toString() as XMLList);
Alert.show(a.text() + "a");
for each(var xml:XML in a)
Alert.show("I am inside" + i);
var attributes:XMLList = xml.attributes();
var o:Object = new Object();
for each (var attribute:XML in attributes)
Alert.show("I am way inside" + i);
var nodeName:String = attribute.name().toString();
var value:*;
Alert.show(attribute.toString());
value = attribute.toString();
i = i+1;
]]>
</mx:Script>
<mx:HTTPService result="handleXMLnew(event);" fault="handleFault(event);" id="xmlRPC" resultFormat="e4x"
url="http://abc/Xcelsius/swat/RCD.xsql" useProxy="false">
</mx:HTTPService>
<mx:XMLListCollection id="xdata" source="{xmlRPC.lastResult.ROW}"/>
<mx:DataGrid dataProvider="{xdata}" x="24" y="110" id="adg1" width="694" height="168"/>
<mx:Button x="653" y="44" label="Go" click="fetch();"/>
</mx:Application>try this, to parse and set the column headers dynamically.
http://flexpearls.blogspot.com/2008/02/generating-dg-columns-for-xml-data.html
Hope this will work. -
Synchronizing methods and a static main method
I have a class with a static main method, calling 3 different jdbc updates.
I want to make sure this is thread safe when called for various clients.
It's goes:
args[0] = clientI
update 1:update field1 where clientid = client1
update 2:update field2 where clientid = client1
update 3:update field3 where clientid = client1I assume I am in jeopardy of mixing up my data?
I don't think I can synchronize a main method, nor would it do any good to synchronize the class?
Should I break the updates into methods, then synchronize them, or synchronize parts of the code?
you opinion would help greatly.You haven't provided enough information.
Are those updates occurring sequentially? Then it's threadsafe.
Are they running in different threads? Then to make them threadsafe you'll need proper synchronization, or a database transaction.
Of course, looking at those particular updates, I don't see any reason why you'd need to worry about thread safety. They look to be independent of each other. Or perhaps you meant you need them to be atomic? That is, any query will see either the old values of all three fields, or the new values of all three fields. Nobody will be able to see the new values for fields 1 and 2, but the old value for field 3. If that's the case, then those three updates need to be in a database transaction. -
How To Pass A Value Read By A Loop To Main Method
Hey everybody,
I'm at this with my code.I'm reading the values of a text file in a loop.I want to pass these values to main method.The importhant point is I want to do this without using a field. The code is below. Thanks.
//Main
public static void main(String[] args)throws FileNotFoundException
DoubleClass AvgScore=new DoubleClass();
IntClass Messenger=new IntClass();
PrintWriter writer1=new PrintWriter("D:\\JavaExercises\\CH07EX14out.txt");
Scanner scan1=new Scanner(new FileReader("D:\\JavaExercises\\CH07EX14data.txt"));
//1 ogrencinin notlarini okut ve ortalamasını hesaplat
while(scan1.hasNext())
writer1.print(scan1.next()+" ");
calcAvg(AvgScore,scan1,Messenger);
//AvgScore formatlanarak yazdirilacak
writer1.print(""+AvgScore+" ");
writer1.print(""+calcGrade(AvgScore)+"\n");
writer1.close();
//calcAvg
public static void calcAvg(DoubleClass x,Scanner y,IntClass z)
int counter=0;
double TotalScore=0;
int NumTests=1;
int Score=0;
//Bir ogrenci icin toplam notu ve test sayisini bul.
while(counter<=4)
Score=y.nextInt();
TotalScore+=Score;
counter++;
NumTests++;
//Bir ogrenci icin not ortalamsi bul.
x.setNum(TotalScore/NumTests);
}Malkavian187 wrote:
Guys please pay attention,
I already said I can't use a field(class scoped variable)and can't use a return type method.
I ve heard that it can be done by passing a reference or primitive variable to my calcAvg method.And than assignin the read values back to this variable.
But I can't figure out how to make it. I need a complete solution.Including modifications to calcAvg and main method.
Take care,Malkavian187,
Maybe you haven't seen other posters asking homework to be done for them, so here is basically what we tell them: DO IT YOURSELF.
And we realize that very possibly you could fail your class from that and have to drop out. This may be a good thing because it will help keep the demand for technical workers up, and thus, keep the pay high.
On the other hand, if you choose to actually do the assignment then we will be happy to give comments on your code. Please post it when you have some and until then, best wishes with what ever you choose to do.
BTW: the solution you allude to requires a field also... and in reality, you already gave the answer--just implement it. If you do not know how: well, maybe you should do one of the following:
1-read and study the Java Tutorial
2-pay more attention to class
3-read your textbook for your class
4-go to class
5-stay awake in class
6-pay attention in class
7-talk to your teacher
8-withdraw from the class
9-change your major -
can anybody help me understand the difference between init and main methods.
I am a beginner,so please take it easy if thequestion seems stupid.
thank you
saumyainit() comes into picture only in servlets !??That isn't what he said, that was just an example. The init() method is used by a lot of APIs, but all for the same basic principal:
The class will be instantiated (the constructor will be called), but the process the class represents may run right away. There may be more initialisation needed. The init() method is called after all initialisation is done, and before the process begins to run. Thus, if you want to prepare your class you use the init() method (so you know it will always occur after full initialisation and before execution).
but you mean,if i am developing an applet then no
need to right main() ?That is correct. You do not need a main() unless your app is a stand-alone application.
and if i am developing a stanalone application
suppose in swing i need not right init() ?That depends. Generally no. But some classes/APIs may require you to.
Maybe you are looking for
-
Need help setting up dnla media server
I have gone to the forum to read what others are using to setup a media server on their intel iMac. I have a 2010 i5 quad core 27" mac and just got a new Panasonic plasma DLNA TV with all of the internet apps. I have Directv with the whole home net
-
Do they load the OS on SSD if purchase from Apple Store
On the website they state that if you buy an iMac with an SSD it will come with the OS loaded on it. Is this also true if you buy the same setup from the Apple store? Can you even buy an iMac with SSD at the store? Thanks for the quick answers. Looks
-
Unix Command Disabled in Startup Items
I have a MaXtor One Touch II. After installing the software, during the Restart, Mac advised me that the security settings for an unknown (to me) file needed to be fixed or disabled. I disabled it and have now realised it was a UNIX command to watch
-
Error when trying to Build ESS application after changes
Hi Guys, I am trying to build DC after changes to the Applciaiton. But the build is failing with the following error. I will able to build and check-in yesterday. Today i am facing this typical issue. Any suggestions please. Jan 30, 2007 11:48:05 AM
-
HT4759 If i haven't upgraded to lion yet can i migrate to icloud when i do upgrade to lion?
If i haven't upgraded to lion yet, can i fully migrate to icloud when i do upgrade to lion?