We are in the process of developing a e-commerce application. It is a web site for a book shop. It is a site very similar to Amazon.com where you can order books online. Front end is in Java Technology. There is however a concern about where to put the business logic.
I am suggesting to put all business logic in the Oracle Database, as stored procedures (i.e. packages). However, one of my colleague says that when you call a Oracle stored procedure from Java, it takes 2 round trips, one to validate the procedure and then to validate the input / ouput parameters of the procedure.
In a website application like what we are trying to build, is it sound advice to put all business logic in the DB? Or should it be in the middle tier (app. server) programmed in Java? Or should you spread in between the middle tier and DB? If so how?
I am having problems in creating an age calculator in java. The only input is your name and date of birth. It means I need to incorporate the current date and make conditions. I am only allowed to use BufferedReader, InputStreamReader and IOException for import. I need to start with this and just add the conditions,
import java.io.InputStreamReader; import java.io.IOException; import java.io.BufferedReader; public class ageactivity { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
[code]...
I tried to add conditions but its not calculating the days.
The first problem is that the numbers don't round in IntelliJ.
Example: ('s in Dutch) Geef de vorige kilometerstand: 125 Geef de huidige kilometerstand: 900 Geef het aantal getankte liters: 50 Verbruik voor 775km: 6.451612903225806/100km
That 6.4516..... is the problem, how can I make it 6.45/100km?
1. ask user to input a decimal 2. output 1 - confirms the input 3. output 2 rounds the input value to the nearest integer.
Here is what I have so far:
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.Scanner; public class IT145Exercise13 { static Scanner console = new Scanner(System.in);
[Code] .....
Results with input of 5.25: run: Enter a decimal: 5.25 You entered 5.25
The integer value is 5 YES however,
BUILD SUCCESSFUL (total time: 6 second)
However, if the input is 5.95 here are the run results:
run: Enter a decimal: 5.95 You entered 5.95 The integer value is 5 Here I expect 6 BUILD SUCCESSFUL (total time: 6 second
Not sure how to ask the output of the variable integerOut to be rounded to the nearest integer?
for standard deviation my output is not rounded to the 10's place, how can I make it round to the 10's place. Here is my code.
import java.util.*; public class chapter7 { public static final int Max_Number_Scores = 100; public static int fillArray(double[] scores) { System.out.print("You entered "); for (int i = 0; i < scores.length; i++) { System.out.print(scores[i] + " ");
I'm currently working on a loan calculator... The only problem I'm having is occasional values that have very long decimals... How do I round the decimals?
I've a question on rounding doubles on 0.05 As far as i know there is no class method that is able to do this. To achieve this rounding i have the following code:
In Main.java, How can i call method in CircleCalculationMethod.java ?
Should I put everything in same folder ??Should i do something like "import CircleCalculationMethod.java"Should i do something like create a package ...
We are using MS SQL server 2000, in which we have explored calling dtsrun.exe from Runtime class in java. But it is not suggested way to call dts, as error handling will be difficult.
I am trying to call a java method in jsp. The main idea is to hide menu based on the user who logs in. The java class flows like this :
public class UserVerification { public static void main(String[] args) { UserVerification obj = new UserVerification(); System.out.print(obj.GetUserVerification("abc"));
I used java and jsf. I created dynamic datatable in java file. Can i call java method from setOnchange() event?
I am able to call java script function from setOnchange() event. See the below code which is working fine for java script.
HtmlSelectOneMenu selectOneMenu = new HtmlSelectOneMenu(); selectOneMenu.setStyleClass("dropdownStyleTwo"); selectOneMenu.setOnchange("openWin(this);IGNORE_UN LOAD=false");
I wrote openwin() function in java script. But i am not able to call java method change().
Code which is not working.
HtmlSelectOneMenu selectOneMenu = new HtmlSelectOneMenu(); selectOneMenu.setStyleClass("dropdownStyleTwo"); selectOneMenu.setOnchange("myclass.change();IGNORE _UNLOAD=false");
myclass is the bean of class Test. If user select any value from dropdown i want to call change java method. This function will apply the same selected dropdown value to the other record also.
I am new to Java and have been learning it. I have a question here. I came across the following Java class and trying to understand it thoroughly but got confused how it is able to call an abstract method. Here is the code I am referring to :
package sampleapps.gui; import javax.swing.*; import java.awt.*; public class InnerClassAnimationExample { int x=70, y=70; public static void main(String[] args) {
[Code] ....
So, in the code above, there is an inner class NewMyDrawPanel which has a paintComponent(Graphics g) method. I have highlighted 2 lines of code above.
Line 1 : Graphics2D g2d = (Graphics2D) g; Line 2 : g2d.fillOval(x,y,40,40);
I understand we are type casting reference g to Graphics2D reference g2d and we are calling fillOval() method on g2d. I don't see a fillOval() method in Graphics2D class but it is there in Graphics class and fillOval method is an abstract method.
So, my question here is :
1. If we are not able to instantiate an abstract class(Graphics2D and Graphics classes), how are we able to access the fillOval() abstract method,
2. Secondly, since the fillOval() method is an abstract method, it does not have any implementation for the method.
However, when I call the method fillOval() on Graphics2D reference, I was able to draw and fill an oval of the specified co-ordinates. So, where would the actual implementation code be?
I have a EAR file which has a java class file and EAR file is deployed in weblogic.I have to call the java class of EAR file from a standalone java code which is present inside a JAR.While making the call to EAR i have to pass a parameter from JAR to one of the methods of class file which is present in EAR.
My question is simple : I only own a List<Object>How can I set each element of _instanceMethod parameter from my List ?? If i decided to iterate through my list such as :
for (Object obj : myList){ _instanceMethod(obj); }
How can I correctly "populate" the _instanceMethod varargs signaturee by the n elements of my list ?
I am trying to make a 2d graphical animation using the java swing classes in order to make a frame. I had a basic version working when all of the code was under the main method, but when I moved some into another method it broke it. With y understanding of java my code should work as I create a variable of the method containing the code and then assign the size and exit button. However this causes many problems such as my BeaconFrame method informing me that it is unused when I have used it. Here is my code:
import javax.swing.*; import java.awt.*; public class BelishaBeacon { public void BeaconFrame() { JFrame frame = new JFrame(); JPanel panel1 = new JPanel();
I'm new to Java. I need to run a SQL server stored procedure(that creates a unique job number) from Oracle SQL Developer (JDBC) in Java. The same Java code will be used in Applescript to run the SP. I found a code snippet online with the similar requirement. How to embed my SP in below code snippet? Below is the Stored Procedure and Code Snippet:
SP
EXEC Int.dbo.GetNewJobNumber '6852', 'Test Job', 'Manual SQL Query' 6852- CustomerCode, Test Job - Job Title, Manual SQL query - Shows how new job number was created.
I have a question about a method I have. In my game, I had a move method to move my player left and right, and originally this method was huge, as it also took care checking collisions and a few other things. I broke it up a bit and put the collisions in their own methods and call them from again another method... Here is an extract which I hope illustrates my point:
private static final double MOVE_SPEED = 0.2; private static final double MAX_MOVE_SPEED = 3.5; private static final double STOP_SPEED = 0.18; private double xPos; private double yPos;
[Code] .....
Something I thought might be a good idea is to check the direction collision when im doing the calculations for that direction:
Then I thought instead i can check it after both of these steps:
if(moveLeft || dx < 0.0) { checkLeft(); }
I guess my question is quite general: How much is acceptable to break up a method? How many chains of method calls is acceptable? Is it ok to call the same method from different nearby places?
I am newbie in java and little bit known to apex. I write an java code and compile it to class file. Now i want to call that class file from an push of button on apex. When button is pushed i need some arguments to be password to java class files . For arguments i need to take the item value from the apex page.
But i stuck on how to call that java class file from apex. On command prompt when i ran java class file, its working.
I am trying to make a calculator using Java GUI. I've managed to make an ActionListener and add it to a button, but I've made an error in my code that I'm unsure of how to solve. Because of how I've written the code, only one number can be placed in the text field. For example, the an ActionListener for the three button on the calculator was added to the button, but no matter how many times the user presses the button, only one 3 will appear in the text field. The code is below:
import javax.swing.*;//import the packages needed for gui import java.awt.*; import java.awt.event.*; public class Calculator { public static void main(String[] args) { JFrame window = new JFrame("Window");//makes a JFrame window.setSize(300,350);
[code].....
As you can see, because the compiler forces the String variable to be final, so when the user presses the button, the code simply shows how a space character and three character would look like, because the String variable can't change. How do I write my code so that every time the user presses the button, a character is added to the text field?
I would like to make a database using HTML and Java. I already made something like this using swing. I am just looking for some pointers here. I just started looking into Java Play 2 and I have a feeling this is what I am looking for. JavaEE is very complicated and I have read that it is being phased out. What is your opinion on this?
I want to make a static HTML page and put it on my home network and treat one of my computers as the sever accessing mySQL.
I want a completely unique GUI with unique buttons, like I could make it a giraffe if I wanted to! (not going to, but a giraffe seemed like a pretty irregular shape) ....
One of my assignments was to make a program that would read a sequence of names and then list them all.Just to be clear, it would read them all first, and then it would list them all at the same time.