Help required for ---- Java Client -- XI -- R/3
Hello,
*My Java Client is on Server A. My XI is on server B. I had wsdl (webservice) with me .*
How to call wsdl (webservice) from Java Client that is on Server A to XI that is on server B.
Pls help
Regards
Good Morning Prateek,
I have tested with Altoval XML spy . It is working fine.
Altoval XML spy (on my local machine) -- XI -- R/3.
Now instead of xml spy I want java client -- XI -- R/3 with scanerio that javal client is on server A and XI on server B.
2. For that request parameter (O/B Interface) I have made wsdl (webservice) through XI .
After making wsdl it ask to save that wsdl.I have saved that wsdl currently
in my local machine.
3.How to call this wsdl (webservice) from Java Client that is on Server A to XI that is on server B.
Pls explain me the all the steps in detail and also send me links/docs for it.
Regards
Similar Messages
-
What the Enviroment required for java databases programs?
Hi guys
What the enviroment required for java databases programs?
If I have oracle of version 9i and java 1.4.1 platform
do I need Jdeveloper platform ?What the enviroment required for java databases programs?What do you mean by "environment"?
f I have oracle of version 9i and java 1.4.1 platformYou just need to download Oracle's 9i JDBC driver (ojdbc14.jar) and put that in your CLASSPATH. Then write JDBC code to connect to Oracle and issue SQL commands.
do I need Jdeveloper platform ?No, JDeveloper is an IDE. Not required.
Why Java 1.4.1? We're up to Java 6 now. You're two major versions of the JDK behind.
% -
Jar files required for Java Proxies
Hi,
Can someone mail me the following jar files required for Java Proxies or tell me where exactly I can find them .?
aii_proxy_xirt.jar
aii_msg_runtime.jar
aii_utilxi_misc.jar
guidgenerator.jar
Regards,
AbhyHi Abhy,
aii_proxy_xirt.jar
C:usrsapJ2EJC00j2eeclusterserver0 inextcom.sap.aii.proxy.xiruntime
aii_msg_runtime.jar C:usrsapJ2EJC00j2eeclusterserver0 inextcom.sap.aii.messaging.runtime
aii_utilxi_misc.jar C:usrsapJ2EJC00j2eeclusterserver0 inextcom.sap.xi.util.misc
guidgenerator.jar C:usrsapJ2EJC00j2eeclusterserver0 inextcom.sap.guid
check this link
http://72.14.203.104/search?q=cache:kBa_MrHu8lAJ:https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/how-to%2520guides%2520-%2520rig%2520official/xi/how%2520to%2520work%2520with%2520xi%25203.0%2520java%2520proxies.pdfjarfilesforaii_proxy_xirt.jar&hl=en&gl=in&ct=clnk&cd=1
just copy the total path and paste in IE..
u will find the jar files required .... with path..
Regards,
Sridhar
Message was edited by: sridhar reddy kondam -
Kadmin: Missing parameters in krb5.conf required for kadmin client while in
Hi all
When i am going to run commands like
kadmin addprinc -randkey
kadmin ktadd -k
i am receiving kadmin: Missing parameters in krb5.conf required for kadmin client while ininitializing kadmin interface
any ideas??
What kind of parameters are missing???
thanks a lotHi,
It is a common problem. I used Oracle Linux to sort it out.
Perhaps you're using the wrong command? AFAIK kadmin should be used when working remotely. You don't say where you are in relation to the server? If sitting at the server you should be using kadmin.local. For example if I issue:
sudo kadmin.local
I get:
Authenticating as principal root/admin@LKDC:SHA1.EB237F611F07B2E8A636804052E8F7252BBA978F with password
If I issue:
sudo kadmin
I get:
Authenticating as principal root/admin@LKDC:SHA1.EB237F611F07B2E8A636804052E8F7252BBA978F with password
If I issue:
sudo kadmin
I get:
Authenticating as principal root/[email protected] with password.
kadmin: Missing parameters in krb5.conf required for kadmin client while initializing kadmin interface
A vital difference. Issuing:
sudo kadmin.local -q list_prinicpals
show show successfully kerberized users, services & hosts. Changing it to kadmin -q list_principals shows nothing except the error message. The above examples are for a client machine.
If you have any questions, ask.
Kirill Babeyev -
Hands on requirement for java certification
which java certifications do exactly have an hands on requirement?
because if i look here
http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=320
it says i just need to take the exam to become certified. other certifications have assignments and more exam but nowhere is an hands-on requirement listed (that i could find)
however if i look here http://education.oracle.com/pls/web_prod-plq-dad/show_desc.redirect?dc=D61748GC10
it says "This course counts towards the Hands-on course requirement for the Java SE 6 Developer Certification. Only instructor-led inclass or instructor-led online formats of this course will meet the Certification Hands-on Requirement. Self Study CD-Rom and Knowledge Center courses DO NOT meet the Hands-on Requirement."
So my question is where exactly can i find which certification has which hands-on requirement. i wouldn't want to start on the self-study (or a non-official course) just to find out that i need the real course to get my certification.
Edited by: 881933 on Aug 27, 2011 8:23 PMWithout looking at specifics .... i am not massively up to speed with the Java certifictions, one key point is the the hands on requirement is about to change.
The latest blog announcement on this may be found helpful: http://blogs.oracle.com/certification/entry/0588
and: http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=449
Some pages cannot be updated until 30th december passes.
Oracle University Courses and LVC courses are appropriate for certification: (CDROMs purchases online though are not):
Rgds -
Help required for unicode compatibilty
Dear All,
We are in a process of analyzing the impact of unicode compatibility for our environment.
Following is our scenario:
- ECC6.0 is non unicode systsem
- Need to buid unicode CRM 7, SCM 7, PI 7.1 and BI7
- Need to integrate the above systems to non unicode ECC system.
Our questions are :
1. Is there any performance consideration when using communication between an Unicode and non-Unicode system?
Is Unicode - Unicode faster than Unicode - non-Unicode communication performance wise?
2. Do we face any technical or functinal problems while trying to integrate
unicode BI/ NW Java Stack to non unicode systems.
3. Do we need to review our sizing estimations due to unicode implemenation?
5. what will be the storage consumption increase for unicode systems compared to non unicode?
It would be greatly helpful for me if you can clarify these doubts.
Thanks and RegardsHi,
1. I think no one has really measured this. I expect a slightly higher requirement for Unicode <--> Non-Unicode interfaces.
2. Please have a look at SAP Notes 838402, 73606, 975768 and 1358929 for restrictions in Non-Unicode systems. SAP highly recommends to go for Unicode in the whole landscape.
3. and 5. If you use the SAP quicksizer (http://service.sap.com/quicksizing), then Unicode is integrated.
" Please note that the Quick Sizer results include Unicode requirements. For more
information on additional requirements caused by Unicode, see
http://service.sap.com/unicode -> Unicode Media Library -> Unicode information on
specific topics: SAP Business Suite Unicode Hardware Requirements"
Best regards,
Nils Buerckel
SAP AG -
Minimal requirements for remote client app to call a EJB 3 session bean
I'm just starting to get into EJBs, trying to learn the EJB 3 APIs. I kind of understand the setup on the server side to create a session bean. What I don't understand is what I would have to deploy for each of the remote client app (Swing-based GUI or something like that) installations. Of course, the client app code would have to be deployed to each client desktop, but what stuff related to the session bean? Just the session bean interface class?
For ease of discussion, let's say my bean is CalculatorBean, having two interfaces, CalculatorRemoteIface and CalculatorLocalIface. Let's also say my client app, CalculatorUI, is a simple Swing-based GUI that grabs a reference to a CalculatorBean.
Other than just the Swing-based classes and the JRE, what JARs/classes will I want to deploy to each desktop?
(Please assume the latest Sun Java System App Server 9 and Java EE 5, if you are familiar with them.)Personally- I would deploy your backend
in EJB 3.0, but then expose it as a web service. It
is MUCH easier for your clients to connect to a web
service (and mantain that code), then to have them
connect via RMI/JNDI.Oh, I would say it's quite the opposite. RMI/JNDI is MUCH easier from a client point of view than web services. To make web services work easy from the client side you have to generate code and the tools that generate code from a web services wsdl file doesn't do a great job today. But that was not the question. But take some time reading this article about webservices...it's quite funny and spot on: http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple
Now to your question, yes you will need the remote interface on the client side.
/klejs -
As far as I know the variables that are used inside java script program are declared using var keyword.
Suppose I assign in the following manner,
var str="Hello";
Is there any way I can using the String functions that java.lang supports . I want to do validaition at the client side. Therefore I assume there is no mandatory requirement , that the client has anything java on his system.Javascript already supports many of the java.lang functions, eg, substring(start, stop), length, splice, split, etc.
Just remember your using Javascript so there may be variations with methods and signatures.
Have a look at either Netscapes or Microsofts Javascript reference.
Anthony -
How to use Http test Client for Java Client Proxy Scenario
Hi,
I build a scenario using Java Client Proxy where JSP as my FrontHand.
Can I know that whether i can use Http Test Client in place of JSP for sending data and getting response back. If yes than how can i implement this ?
Regards,
AbhiHi,
with Http Test Client you post your messages
directly to the Integration Engine (not using adapter framework)
so you can use Http Test Client to simulate any message
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
Help files for Java??
I need help..because i can not find the right files to download for Java Creator..it says no documention found!!!!??? Where can i download help ??
I need help..because i can not find the right files to download for Java Creator..it says no documention found!!!!??? Where can i download help ??
-
No Scenario Defaults for Java Client Preferences?
I am using Java Client in e-load. To access our applications I have to use a proxy and therfore I have to change the Java Client Preferences Proxy Host and Proxy Port. In the Scenario Defaults I can not find Java Client Preferences. What can I do to change the Settings only one time and not every time when I run a script?
If you have the latest e-Test Suite version 8.20 you can modify these settings in Scenario Defaults-> Java Client Preferences section. This download is available here on the QA Zone.
http://qazone.empirix.com/entry!default.jspa?categoryID=15&externalID=221&fromSearchPage=true
If instead you decide to modify the JavaAgent.Properties file, you must remember to modify the same file on all your agent machines. You JA properties file settings are not distributed from the eload controller to all your agent machines. -
PCUI 4.0, Search Help Required for New field
Hi everyone
I am working in CRM 4.0 Sales Order application
We created a new field in CRM sales Order in Header level in SAP GUI through EEWB.
The search help for the new field is working fine in SAP GUI. We want to add the same field with F4 help functionaliity in PCUI as well.
The field has been added in structure CRMT_BSP_SLS_OD1_General. It also shows domain value for the field however Origin of input field ie empty
The field has been added in PCUI and is successfully showing data inputted in SAPGUI
However we need search help functionality for the field
i tried these two steps
1) i checked on domain value checkbox and changed the field from input to dropdown. However the dropdown is empty in PCUI. Whenever i check box domain values for some field then all the possible values in SPA GUI are displayed in PCUI, however this is not working here.
2) I put Value_table in F4 of the field
This is also throwing up empty values
Am i missing something in this case
Please let me know how to go about it
TIA
AsadHi Frederic
Thanks for your response
I am not sure what is meant by regenerating the field group in this case
I added the entries for my view in the field group and generated the layout of the field group (If this is what you mean)
The field is working fine. I am able to save values to the field and able to see values saved in GUI.
I haven't linked search help of the field in PCUI
I am not sure how to go about it.
I used the data element in the structure for the field.
The data element has Domain entry in <b>Entry Help/Check</b> of the structure
If i check the Domain Value checkbox in my field group then the domain values should be available in dropdown if the field is dropdown
However i am not able to see the possible values of the field (It is present in SAP GUI)
Does something else needs to be done in this case
TIA
Asad -
Seeburger help required for 810 and Dispatch Advice (IDOC type DESADV).
Hi All,
1. Please let me know blogs which clearly shows settings for Seeburger components for 850 (Purchase Order) to IDOC Scenario
--- Seeburger Workbench
--- Seeburger Mapping Designer (BIC)
--- Seeburger Counter and Varaibles
--- Seeburger AS2 Spoke
--- Any other Seeburger Component setting required
I have understand blog for 850 -- /people/rajeshkumar.pasupula/blog/2009/08/05/wanna-implement-seeburger-for-edi-find-the-booster
2. Anybody has blog for 810 or Dispatch Advice (IDOC type DESADV).
3. Can anybody provide me Mapping Logic (at field level) done in XI/PI for 850, 810 , Dispatch Advice (IDOC type DESADV) .
RegardsHi Rickkk,
1. Please let me know blogs which clearly shows settings for Seeburger components for 850 (Purchase Order) to IDOC Scenario
--- Seeburger Workbench
--- Seeburger Mapping Designer (BIC)
--- Seeburger Counter and Varaibles
--- Seeburger AS2 Spoke
--- Any other Seeburger Component setting required
For SEEBURGER workbench please go through this blog and navigate the enbebbed links furthur to know about Seeburger workbench too.
/people/prateek.srivastava3/blog/2009/08/01/seeburger--part-1--the-basics
2
2. Anybody has blog for 810 or Dispatch Advice (IDOC type DESADV).
For 810 i think the procedure would be the same but themseeburger mapping program that validates the ANSX 810 would be different.As far as 997is concerned 997 is a functional acknowledgement.Its a genric format that is used to send acknowledgement for any EDI transaction set that has been sent.
3. Can anybody provide me Mapping Logic (at field level) done in XI/PI for 850, 810 , Dispatch Advice (IDOC type DESADV) .
The logic will be based on the trading partner guidelines which will contain the description of all the semantic and syntactiic description about the segments ,its feilds.we need to consider the guidelines and target side specifications too while mapping.
Thanks,
Ram. -
Minimum Hardware Requirement for Oracle11gAS Client PC
as subject, can anyone give me some feedback? thanks!
Assuming you are referring to Fusion Middleware 11, I will start by saying that this is a product set of many components and install options. To even offer a suggested recommendation for hardware would heavily depend on exactly what you are planning to install and do with this installation.
I would recommend review the product installation guides. That said, when reviewing the minimum requirements for memory (RAM), I would recommend that you consider at least adding 15-20% more than what is document. Remember that these are minimum requirements for installation and basic use and not requirements to actually use these products in production with load.
Product Documentation
http://download.oracle.com/docs/cd/E21764_01/index.htm
System Requirements
http://download.oracle.com/docs/html/E18558_01/fusion_requirements.htm
Also note that in most cases, reference to memory (RAM) is for the product and not necessarily the box. Unless otherwise noted in the document, you need to consider everything else you are running on the machine including the OS. So, for example, if the install guide says you need a minimum of 2gig of RAM, this does not take into account what the OS needs. So, in this example, consider the 2gig documented plus 20% (as suggested above) plus about 1.5 gig for the OS and other minimal apps running, you would need approximately 4gig of RAM just to complete an installation and execute basic features. In many cases the documentation now refers to "minimum RAM" and "available RAM". "Available RAM" in the document refers to RAM plus swap (virtual memory). My recommendation is not referring to swap. Although the documentation is correct and does work, you will be much happier with more RAM installed.
Bottom line, in the case of RAM, more is always better. However, remember that on some 32bit OSs there is a limitation as to how much RAM can be accessed. Be sure to refer to the OS documentation for details.
I forgot to mention, your question would probably get better feedback in the "Applcation Server" forum area:
Oracle Application Server - General
Edited by: Michael Ferrante on Aug 2, 2011 10:21 AM -
Urgent Help Required for Connect Four Game
Hi all,
I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
Sorry there is so much code.
This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
Interface code..............
interface Player {
void init (Boolean color);
String name ();
int move ();
void inform (int i);
Player1 class......................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class Player1 implements Player
public Player1()
public int move()
Scanner scan = new Scanner(System.in);
// BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
int player1;
System.out.println ("What is your Number, player 1?");
player1 = scan.nextInt();
System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
System.out.println();
return player1;
//Player.move();
//return player1;
}//end move method
public void init (Boolean color)
public void inform (int i)
public String name()
return "Koonda";
}//end player1 class
Player2 class...........................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class Player2 implements Player
public int move()
//int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
// cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
//int num1, num2;
Scanner scan = new Scanner(System.in);
// BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
int player2;
System.out.println ("What is your Number, player 2?");
player2 = scan.nextInt();
System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
System.out.println();
//return player1;
return player2;
}//end move method
public void init (Boolean color)
public void inform (int i)
public String name()
return "malook";
}//end player1 class
PlayGame class which contains all the functionality.........................................................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class PlayGame
//Player player1;
//Player player2;
int [][]ConnectFourArray;
boolean status;
int winner;
int player1;
int player2;
public PlayGame()
//this.player1 = player1;
//this.player2 = player2;
public void StartGame()
try{
// int X = 0, Y = 0;
//int value;
int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
int[][] ConnectFourArray = new int[6][7];
int num1, num2;
for(int limit=21;limit!=0;limit--)
BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
String column1;
System.out.println();
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
System.out.println ("Please Select a column of 0 through 6 ");
column1 = selecter.readLine();
num1= Integer.parseInt(column1);
System.out.println();
if (num1==0){
ConnectFourArray[cup0][0]=1;
cup0=cup0-1;
else if (num1==1){
ConnectFourArray[cup1][1]=1;
cup1=cup1-1;
else if (num1==2){
ConnectFourArray[cup2][2]=1;
cup2=cup2-1;
else if (num1==3){
ConnectFourArray[cup3][3]=1;
cup3=cup3-1;
else if (num1==4){
ConnectFourArray[cup4][4]=1;
cup4=cup4-1;
else if (num1==5){
ConnectFourArray[cup5][5]=1;
cup5=cup5-1;
else if (num1==6){
ConnectFourArray[cup6][6]=1;
cup6=cup6-1;
System.out.println();
BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
String column2;
System.out.println();
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
System.out.println ("Please Select a column of 0 through 6 ");
column1 = selecter.readLine();
num1= Integer.parseInt(column1);
System.out.println();
if (num1==0){
ConnectFourArray[cup0][0]=2;
cup0=cup0-1;
else if (num1==1){
ConnectFourArray[cup1][1]=2;
cup1=cup1-1;
else if (num1==2){
ConnectFourArray[cup2][2]=2;
cup2=cup2-1;
else if (num1==3){
ConnectFourArray[cup3][3]=2;
cup3=cup3-1;
else if (num1==4){
ConnectFourArray[cup4][4]=2;
cup4=cup4-1;
else if (num1==5){
ConnectFourArray[cup5][5]=2;
cup5=cup5-1;
else if (num1==6){
ConnectFourArray[cup6][6]=2;
cup6=cup6-1;
System.out.println();
System.out.println();
catch (Exception E){
System.out.println("Error with input");
System.out.println("Would you like to play again");
try{
String value;
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
// Scanner scan = new Scanner(System.in);
System.out.println("Enter yes to play or no to quit");
// value = scan.nextLine();
// String value2;
value = reader.readLine();
//value2 = reader.readLine();
if (value.equals("yes"))
System.out.println("Start again");
StartGame(); // calling the StartGame method to play a game once more
else if (value.equals("no"))
System.out.println("No more games to play");
// System.exit(0);
else
System.exit(0);
System.out.println();
catch (Exception e){
System.out.println("Error with input");
finally
System.out.println(" playing done");
//StartGame();
//check for horizontal win
public int hasWon()
int status = 0;
for (int row=0; row<6; row++)
for (int col=0; col<4; col++)
if (ConnectFourArray[col][row] != 0 &&
ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
//status = true;//int winner;
if(status == player1)
System.out.println("Player 1 is the winner");
else if(status == player2)
System.out.println("Player 2 is the winner" );
}//end inner for loop
}// end outer for loop
} // end method Winner
return status;
}//end class
ClassConnectFour which designs the board........................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class ClassConnectFour
//Player player1;
//Player player2;
public ClassConnectFour()
//this.player1 = player1;
public void DrawBoard()
int[][] ConnectFourArray = new int[6][7] ;
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
}//end class
TestConnetFour class which uses most of the above class..................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class TestConnectFour
public static void main(String[] args)
ClassConnectFour cf = new ClassConnectFour();
cf.DrawBoard();
Player1 player1 = new Player1();
Player2 player2 = new Player2();
player1.move();
player2.move();
System.out.println("Number 1 belongs to player " + player1.name());
System.out.println("Number 2 belongs to player " + player2.name());
PlayGame pg = new PlayGame();
pg.StartGame();
pg.hasWon();
//pg.Play();
//System.out.println(player.name());
//System.out.println(player2.name());
}// end main
}//end class
I am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
Thanks in advance.
Koonda
//Hi,
Thanks for your help but I really don't understand the table lookup algorithm. Could you please send me some code to implement that.
I will send you the formatted code as well
Thanks for your help.
looking forward to your reply.
Koonda
Hi all,
I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
Sorry there is so much code.
This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
Interface code..............
interface Player {
void init (Boolean color);
String name ();
int move ();
void inform (int i);
Player1 class......................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class Player1 implements Player
public Player1()
public int move()
Scanner scan = new Scanner(System.in);
// BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
int player1;
System.out.println ("What is your Number, player 1?");
player1 = scan.nextInt();
System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
System.out.println();
return player1;
//Player.move();
//return player1;
}//end move method
public void init (Boolean color)
public void inform (int i)
public String name()
return "Koonda";
}//end player1 class
Player2 class...........................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class Player2 implements Player
public int move()
//int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
// cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
//int num1, num2;
Scanner scan = new Scanner(System.in);
// BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
int player2;
System.out.println ("What is your Number, player 2?");
player2 = scan.nextInt();
System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
System.out.println();
//return player1;
return player2;
}//end move method
public void init (Boolean color)
public void inform (int i)
public String name()
return "malook";
}//end player1 class
PlayGame class which contains all the functionality.........................................................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class PlayGame
//Player player1;
//Player player2;
int [][]ConnectFourArray;
boolean status;
int winner;
int player1;
int player2;
public PlayGame()
//this.player1 = player1;
//this.player2 = player2;
public void StartGame()
try{
// int X = 0, Y = 0;
//int value;
int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
int[][] ConnectFourArray = new int[6][7];
int num1, num2;
for(int limit=21;limit!=0;limit--)
BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
String column1;
System.out.println();
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
System.out.println ("Please Select a column of 0 through 6 ");
column1 = selecter.readLine();
num1= Integer.parseInt(column1);
System.out.println();
if (num1==0){
ConnectFourArray[cup0][0]=1;
cup0=cup0-1;
else if (num1==1){
ConnectFourArray[cup1][1]=1;
cup1=cup1-1;
else if (num1==2){
ConnectFourArray[cup2][2]=1;
cup2=cup2-1;
else if (num1==3){
ConnectFourArray[cup3][3]=1;
cup3=cup3-1;
else if (num1==4){
ConnectFourArray[cup4][4]=1;
cup4=cup4-1;
else if (num1==5){
ConnectFourArray[cup5][5]=1;
cup5=cup5-1;
else if (num1==6){
ConnectFourArray[cup6][6]=1;
cup6=cup6-1;
System.out.println();
BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
String column2;
System.out.println();
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
System.out.println ("Please Select a column of 0 through 6 ");
column1 = selecter.readLine();
num1= Integer.parseInt(column1);
System.out.println();
if (num1==0){
ConnectFourArray[cup0][0]=2;
cup0=cup0-1;
else if (num1==1){
ConnectFourArray[cup1][1]=2;
cup1=cup1-1;
else if (num1==2){
ConnectFourArray[cup2][2]=2;
cup2=cup2-1;
else if (num1==3){
ConnectFourArray[cup3][3]=2;
cup3=cup3-1;
else if (num1==4){
ConnectFourArray[cup4][4]=2;
cup4=cup4-1;
else if (num1==5){
ConnectFourArray[cup5][5]=2;
cup5=cup5-1;
else if (num1==6){
ConnectFourArray[cup6][6]=2;
cup6=cup6-1;
System.out.println();
System.out.println();
catch (Exception E){
System.out.println("Error with input");
System.out.println("Would you like to play again");
try{
String value;
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
// Scanner scan = new Scanner(System.in);
System.out.println("Enter yes to play or no to quit");
// value = scan.nextLine();
// String value2;
value = reader.readLine();
//value2 = reader.readLine();
if (value.equals("yes"))
System.out.println("Start again");
StartGame(); // calling the StartGame method to play a game once more
else if (value.equals("no"))
System.out.println("No more games to play");
// System.exit(0);
else
System.exit(0);
System.out.println();
catch (Exception e){
System.out.println("Error with input");
finally
System.out.println(" playing done");
//StartGame();
//check for horizontal win
public int hasWon()
int status = 0;
for (int row=0; row<6; row++)
for (int col=0; col<4; col++)
if (ConnectFourArray[col][row] != 0 &&
ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
//status = true;//int winner;
if(status == player1)
System.out.println("Player 1 is the winner");
else if(status == player2)
System.out.println("Player 2 is the winner" );
}//end inner for loop
}// end outer for loop
} // end method Winner
return status;
}//end class
ClassConnectFour which designs the board........................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class ClassConnectFour
//Player player1;
//Player player2;
public ClassConnectFour()
//this.player1 = player1;
public void DrawBoard()
int[][] ConnectFourArray = new int[6][7] ;
for ( int row=0; row < ConnectFourArray.length; row++ ){
System.out.print("Row " + row + ": ");
for ( int col=0; col < ConnectFourArray[row].length; col++ )
System.out.print( ConnectFourArray[row][col] + " ");
System.out.println();
System.out.println();
}//end class
TestConnetFour class which uses most of the above class..................
import java.util.*;
import java.io.*;
import javax.swing.*;
public class TestConnectFour
public static void main(String[] args)
ClassConnectFour cf = new ClassConnectFour();
cf.DrawBoard();
Player1 player1 = new Player1();
Player2 player2 = new Player2();
player1.move();
player2.move();
System.out.println("Number 1 belongs to player " + player1.name());
System.out.println("Number 2 belongs to player " + player2.name());
PlayGame pg = new PlayGame();
pg.StartGame();
pg.hasWon();
//pg.Play();
//System.out.println(player.name());
//System.out.println(player2.name());
}// end main
}//end classI am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
Thanks in advance.
Koonda
Maybe you are looking for
-
Quantity Issue while Reversing a Paid Credit Memo of Vendor Return PO?
Has anyone encountered the following problem when posting & reversing GRIR transactions against a Vendor Return PO'? We have a Vendor Return PO with a single line item - the return indicator is checked. The PO is issued and released. The GR is entere
-
How I can use old iPhoto library?
Good day! I've re-installed Lion on my Mac. Before that I had copied my iPhoto Library on external HD (copy&paste iPhoto Library folder). When i've installed Lion - i copy my iPhoto Library to Pictures folder. But iPhoto don't work with it. I try to
-
How to export sap bi data in to oracle bi
Hi Experts, How to export sap bi data in to oracle bi. what is the connection used for this . Plz assist me, Thanks & Regards, P.Swaroop.
-
Using Tangosol Coherence in conjunction with Kodo JDO for distributing caching
JDO currently has a perception problem in terms of performance. Transparent persistence is perceived to have a significant performance overhead compared to hand-coded JDBC. That was certainly true a while ago, when the first JDO implementations were
-
Problem setting project end point (can't access the end point marker)
I can't seem to set my project end point because the slider control that adjusts the spacing of the measures is obstructing my pointer from being able to click on the end point marker. Any hints as to how I can move the coation of this slider control