Stored Procedure Inside SSIS Successful but does not Perform INSERT - First time since Pkg Created
All - We have a Stored Proc that Runs inside a SSIS package and INSERTS in a table and it was developed a Year Ago - After almost one year this Stored Procedure runs and DOES NOT INSERT - and when I pull the procedure out and Manually runs it -
it runs totally fine.
Did anyone face anything like this before ?
It does create around 10 temp tables before running the INSERT and it INSERTS around 2.5 Million rows. And its a Wide table with 180 Columns
When you execute the Stored Procedure directly in SSMS (SQL Server Management Studio), it execute under the login that you open SSMS, it was be a Window login or SQL Server one.
So from SSIS packages, you have to ways :
1. When you execute the package from SSIS, it execute under the service that SSIS run.
2. When you scudule the package in SQL Agent, the package execute under the account service of SSIS, or another one (you can specify) by impersonation.
Ok, for the solution, i prefere change the impersonate before call procedure, exactly change the current login to another that have the priviliges to execute and insert the Data in the table like :
1. Edit the SP.
2. before the T-SQL type :
EXECUTE AS USER = 'yourLogin';3. retryTo understand the impersonation :http://msdn.microsoft.com/fr-fr/library/ms181362.aspx
Similar Messages
-
Photosmart 7520 e-ALL-IN-ONE appears to send email from scan successfully but does not
The scanner scans and appears to send the email successfully, actually confirms the email has been sent but does not arrive
This question was solved.
View Solution.Hi Anne,
Thank you for the update. It’s great that we solved one issue, now onto the next ...
Please Try the HP Print and Scan Doctor for Windows. The Print and Scan Doctor diagnoses and helps resolve common printing, scanning, and connectivity problems. It should resolve the problem, or at least point you in the right direction to solve the issue of the missing text. If it doesn’t, please try following the steps in Troubleshooting Print Quality Issues.
Regards,
Happytohelp01
Please click on the Thumbs Up on the right to say “Thanks” for helping!
Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
I work on behalf of HP -
SSRS - Oracle Stored procedure returns no data but does in SQL Developer Sudio
HI there,
Stored procedure returns no data when executed on the report but when i execute the stored procedure in Sql Developer it returns required rows.
Thanks for your help!Hi Simon,
When i test with simple query, i get the data.
For your convenience, my stored proc looks lyk :
PROCEDURE pr_REPORT_data(P_STARTDATE IN DATE, P_ENDDATE IN DATE, data_rows OUT T_CURSOR) AS
OPEN completed_Reinstatement FOR
SELECT
value1,.......value5
FROM table1
WHERE
To_Date(createdDate, 'YYYY/MM/DD') BETWEEN To_Date(P_STARTDATE, 'YYY/MM/DD') AND To_Date(P_ENDDATE, 'YYYY/MM/DD');
END pr_REPORT_data;
T_CURSOR is of type cursor which is declared on the package.
I'm assuming the problem is with date parameters, however i converted the date before passing to
WHERE clause. -
Hi all,
I am having trouble with an edge animation on a web page. It doesn't load the first time the page is loaded, but loads fine the second time or any time after that. To test I am clearing my cache, then reloading the page. It seams to work in IE the first time but not Firefox or chrome.
I have a temporary copy of the page here ... http://emiwip.com/monique-mathieu/landing-page-wip.html
Can anyone tell me what is going on?
Thanks.
DanI found the answer here ... Publishing no longer works in latest Edge
It appears that you need to load the latest jQuery in the head of the pag. That fixes it.
Dan -
Bumblebee does not work every first time I start it
When I ran
optirun firefox
it failed and showed
[ 7661.980841] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) systemd-logind: failed to get session: PID 16651 does not belong to any known session
[ 7661.980869] [ERROR]Aborting because fallback start is disabled.
But when I tried running again it worked.
journalctl:
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929488] [WARN][XORG] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929507] [WARN][XORG] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929519] [ERROR][XORG] (EE) systemd-logind: failed to get session: PID 16651 does not belong to any known session
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929523] [ERROR][XORG] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929527] [WARN][XORG] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929538] [WARN][XORG] (WW) Unresolved symbol: fbGetGCPrivateKey
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929545] [ERROR][XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0. Please
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929548] [ERROR][XORG] (EE) NVIDIA(GPU-0): check your system's kernel log for additional error
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929551] [ERROR][XORG] (EE) NVIDIA(GPU-0): messages and refer to Chapter 8: Common Problems in the
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929554] [ERROR][XORG] (EE) NVIDIA(GPU-0): README for additional information.
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929557] [ERROR][XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics device!
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929560] [ERROR][XORG] (EE) NVIDIA(0): Failing initialization of X screen 0
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929564] [ERROR][XORG] (EE) Screen(s) found, but none have a usable configuration.
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929567] [ERROR][XORG] (EE)
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929570] [ERROR][XORG] (EE) no screens found(EE)
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929573] [ERROR][XORG] (EE)
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929577] [ERROR][XORG] (EE) Please also check the log file at "/var/log/Xorg.8.log" for additional information.
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929580] [ERROR][XORG] (EE)
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929583] [ERROR][XORG] (EE) Server terminated with error (1). Closing log file.
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.980795] [ERROR]X did not start properly
8月 28 22:12:24 swordfeng-PC kernel: nvidia 0000:01:00.0: irq 50 for MSI/MSI-X
8月 28 22:12:24 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:24 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:24 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:24 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:24 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:24 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:24 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:24 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:24 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069802] [WARN][XORG] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069813] [WARN][XORG] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069828] [ERROR][XORG] (EE) systemd-logind: failed to get session: PID 16943 does not belong to any known session
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069831] [ERROR][XORG] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069833] [WARN][XORG] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069839] [WARN][XORG] (WW) Unresolved symbol: fbGetGCPrivateKey
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069845] [WARN][XORG] (WW) NVIDIA(0): Unable to get display device for DPI computation.
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069849] [ERROR][XORG] (EE) NVIDIA(0): Failed to initiate mode change.
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069851] [ERROR][XORG] (EE) NVIDIA(0): Failed to complete mode change
8月 28 22:12:25 swordfeng-PC bumblebeed[254]: [ 7831.069859] [ERROR][XORG] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
8月 28 22:12:29 swordfeng-PC kernel: [drm] Module unloaded
8月 28 22:12:29 swordfeng-PC kernel: bbswitch: disabling discrete graphics
8月 28 22:12:29 swordfeng-PC kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
8月 28 22:12:29 swordfeng-PC kernel: pci 0000:01:00.0: Refused to change power state, currently in D0
8月 28 22:12:29 swordfeng-PC bumblebeed[254]: [ 7834.886245] [ERROR][XORG] (EE) Server terminated successfully (0). Closing log file.
22:09 is the first time and 22:12 is the second time.
I tried what the wiki Troubleshooting section 'systemd-logind: failed to get session: PID XXX does not belong to any known session' said but nothing changed.Did you do this:
8月 28 22:09:36 swordfeng-PC bumblebeed[254]: [ 7661.929577] [ERROR][XORG] (EE) Please also check the log file at "/var/log/Xorg.8.log" for additional information.
Any additional info there?
optirun -vv firefox
could give some hints too.
Did it ever work? Or is this your first try with bumblebee on that system? -
HTTP Request returns success, but does not work in azure
I created a simple worker role project that sends an HTTP GET request to the weather underground site to update my weather stats from my weather station. The data it sends is pulled from a SQL database stored on Azure.
The solution works perfectly when I run it on my local emulator. When I deploy it to staging in azure it runs without error. I even get an HTTP success as the response to my GET. However, my weather underground stats don't get updated.
I connected the VS debugger to azure and can step through the code and it all seems to work as expected. I get back an appropriate HTTP response.
Thoughts???
Thanks,
McPI figured it out. Upon close inspection I noticed that the date and time value that I was setting in my query string was off by 4 hours. See, azure uses UTC time. The service I was calling expects the datetime to be UTC as well. So,
I was doing a simple conversion to UTC time in my code. However, because the time was being stored in the database as local time, when I would call the conversion in code it was basically adding 0 hours to it because the azure instance was already running
in UTC. So, I ended up doing a little time zone math to calculate the difference between my zone and UTC and then added that to the time coming from the database.
The reason it was returning success was because the service allows you to update older records. However, if you are just looking at current weather conditions you would think that it wasn't being updated.
So remember - Azure runs on UTC time!!! -
Hi All,
I have added custom assembly to analysis services and trying to call the function in the MDX with the below format
AssemblyName.NameSpace.Class.FunctionName(Dimensions)
I dont know exactly where am I doing wrong, please let me know if anyone has come cross this issue.
Thanks,
ATRSAMSBelow is the script I have used to create assembly, if any one have used this script and have found root cause, please let me know. Also let me know if you need more detailsnamespace SSAS_StoredProcedure_Sort
classMDXStoredProc
privateclassTupleValue : System.IComparable
private Microsoft.AnalysisServices.AdomdServer.Tuple _Tuple;
internal Microsoft.AnalysisServices.AdomdServer.Tuple Tuple
get { return _Tuple; }
privateset { _Tuple = value; }
privatedecimal _Value;
public TupleValue(Microsoft.AnalysisServices.AdomdServer.Tuple t, decimal v)
_Tuple = t;
_Value = v;
publicint CompareTo(object obj)
if (obj isTupleValue)
TupleValue tv = (TupleValue)obj;
return tv._Value.CompareTo(_Value);
thrownew System.ArgumentException("object is not a TupleValue");
publicSet Order(Set InputSet, Expression SortExpression)
List<TupleValue> TupleValues = newList<TupleValue>();
int i = 0;
foreach (Microsoft.AnalysisServices.AdomdServer.Tuple t in InputSet.Tuples)
TupleValues.Add(newTupleValue(t, (decimal)SortExpression.Calculate(t)));
i++;
int cTuples = i;
TupleValues.Sort();
SetBuilder sb = newSetBuilder();
for (i = 0; i < cTuples; i++)
sb.Add(TupleValues[i].Tuple);
return sb.ToSet(); -
Program object schedule success but is not executed in real time
Hi all,
I have a batch file ad following is the content
set path=C:\WINDOWS\system32
echo Copying started at %date% %time%>>_date_.txt
XCOPY "
Boxis\c$\Program Files\Business Objects\Tomcat55\webapps\dswsbobje\WEB-INF\classes\qaawsWsdl.zip" "
Sxi31\d$\Program Files\Business Objects\Tomcat55\webapps\dswsbobje\WEB-INF\classes" /s /a /d
echo Copying finished at %date% %time%>>_date_.txt
echo Completed Successfully at %date% %time%>>_date_.txt
echo -
>>_date_.txt
pause
I have uploaded this batch file in enterprise. When I schedule it the status is shown as Success however the file qaawsWsdl.zip is not copied to the destination.
Note: When executing the batch file real time the file is getting copied
I have added the user in Replace a process level token policy
I have set program object rights to run script/binaries
SIA is running on domain account that has access to source as well as destination folders.
Am I missing something?
Environment
Business Objects XI 3.1 SP3 clustered (Also tried above in standalone, same issue)
Windows Server 2003The program object will run with the credentials of the user you provided in the schedule panel unless you did not provide any and you have set a default user account in the CMC under Application->CmC->Program object settings. THis user has to have access on the source and target directories.
What you can do is try to login manually on the BOBJ server using the credentials of the windows user that runs the program object and try to run the script from the command line.
The domain account under which the SIA is running is not really relevant
Regards,
Stratos -
I can still load it with the script running or attempting to run in the background but it makes firefox tremendously slow. After I click on stop running the script then everything seems to be ok.
how do I get the script not to run in the first place.In Firefox the use of the term chrome refers to the user interface and other elements that are not part of the web pages.
See https://developer.mozilla.org/en/Chrome
Your problems seems to be caused by the GreaseMonkey extension.<br />
See [[Troubleshooting extensions and themes]] -
When I type in a keyword for a batch of Photos it will not take. It only takes the second time i enter the keyword?
Do you have that problem when running in the Firefox SafeMode?<br/> ''A troubleshooting mode.''<br />
You can open the Firefox 4.0 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut. Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut to open it again.''
If not, see this: <br />
http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes -
My iphone 4 has face time capability but does not have the face time app in settings to turn it on. I have done a restore and it didn't do anything. Can anyone help?
There is no FaceTime app. To initiate FaceTime go the contact page of the person you want to FaceTime in your Contacts app and select FaceTime at the bottom of the screen.
-
Compiles but does not execute as expected????
Here is my code. I can compile and execute but does not perform as expected What do I need to change?
import java.io.;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.NumberFormat;
import java.math.*;
public class CalcTest extends JFrame implements ActionListener, ItemListener
public JMenuBar createMenuBar()
JMenuBar mnuBar = new JMenuBar();
setJMenuBar(mnuBar);
//Create File & add Exit
JMenu mnuFile = new JMenu("File", true);
mnuFile.setMnemonic(KeyEvent.VK_F);
mnuFile.setDisplayedMnemonicIndex(0);
mnuBar.add(mnuFile);
JMenuItem mnuFileExit = new JMenuItem("Exit");
mnuFileExit.setMnemonic(KeyEvent.VK_F);
mnuFileExit.setDisplayedMnemonicIndex(1);
mnuFile.add(mnuFileExit);
mnuFileExit.setActionCommand("Exit");
mnuFileExit.addActionListener(this);
JMenu mnuFunction = new JMenu("Function", true);
mnuFunction.setMnemonic(KeyEvent.VK_F);
mnuFunction.setDisplayedMnemonicIndex(0);
mnuBar.add(mnuFunction);
JMenuItem mnuFunctionClear = new JMenuItem("Clear");
mnuFunctionClear.setMnemonic(KeyEvent.VK_F);
mnuFunctionClear.setDisplayedMnemonicIndex(1);
mnuFunction.add(mnuFunctionClear);
mnuFunctionClear.setActionCommand("Clear");
mnuFunctionClear.addActionListener(this);
// Fields for Principle
JPanel row1 = new JPanel();
JLabel dollar = new JLabel("How much are you borrowing?");
JTextField money = new JTextField("", 15);
// Fields for Term and Rate
JPanel row2 = new JPanel();
JLabel choice = new JLabel("Select Year & Rate:");
JCheckBox altchoice = new JCheckBox("Alt. Method");
JTextField YR = new JTextField("", 4);
JTextField RT = new JTextField("", 4);
//Jcombobox R=rate,Y=year
String[] RY = {
"7 years at 5.35%", "15 years at 5.5 %", "30 years at 5.75%", " "
JComboBox mortgage = new JComboBox(RY);
// Fields for Payment
JPanel row3 = new JPanel();
JLabel payment = new JLabel("Your monthly payment will be:");
JTextField owe = new JTextField(" ", 15);
//Scroll Pane and Text Area
JPanel row4 = new JPanel();
JLabel amortization = new JLabel("Amortization:");
JTextArea chart = new JTextArea(" ", 7, 22);
JScrollPane scroll = new JScrollPane(chart, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
StringBuffer amt = new StringBuffer();
Container pane = getContentPane();
FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
JButton Cal = new JButton("Calculate");
NumberFormat currency = NumberFormat.getCurrencyInstance();
public CalcTest()
// Title and Exit of JFrame
super("Mortgage and Amortization Calculator");
setSize(475, 328);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//JFrame layout
pane.setLayout(flow);
//Input output fields added to JFrame
row1.add(dollar);
row1.add(money);
pane.add(row1);
mortgage.setSelectedIndex(3);
mortgage.addActionListener(this);
mortgage.setActionCommand("mortgage");
row2.add(altchoice);
altchoice.addItemListener(this);
row2.add(choice);
YR.setEditable(false);
RT.setEditable(false);
row2.add(YR);
row2.add(RT);
row2.add(mortgage);
pane.add(row2);
row3.add(payment);
row3.add(owe);
pane.add(row3);
owe.setEditable(false);
//Scroll Pane added to JFrame
row4.add(amortization);
chart.setEditable(false);
row4.add(scroll);
pane.add(row4);
//Executable Button- Clear,Exit, Calculate
JPanel row5 = new JPanel();
JButton clear = new JButton("Clear");
clear.addActionListener(this);
row5.add(clear);
pane.add(row5);
JButton exit = new JButton("Exit");
exit.addActionListener(this);
row5.add(exit);
Cal.setEnabled(false);
Cal.addActionListener(this);
row5.add(Cal);
pane.add(row5);
setContentPane(pane);
setVisible(true);
} //End of constructor
private void calculate()
String loanAmount = money.getText();
if(loanAmount.equals(""))
return;
double P = Double.parseDouble(loanAmount);
int y;
double r;
if(altchoice.isSelected())
if(YR.getText().equals("") || RT.getText().equals(""))
return;
y = Integer.parseInt(YR.getText());
r = Double.parseDouble(RT.getText());
else
int index = mortgage.getSelectedIndex();
if(index == 3)
return;
int[] terms = { 7, 15, 30 };
double[] rates = { 5.5, 5.35, 5.75 };
y = terms[index];
r = rates[index];
double In = r / (100 * 12.0);
double M = P * (In / (1 - Math.pow(In + 1, -12.0 * y)));
owe.setText(currency.format(M));
//Column Titles for Text Area
chart.setText("Pmt#\tPrincipal\tInterest\tBalance\n");
for (int i = 0; i < y * 12; i++)
{ double interestAccrued = P * In;
double principalPaid = M - interestAccrued;
chart.append(i + 1 + "\t" + currency.format(principalPaid)
+ "\t" + currency.format(interestAccrued)
+ "\t" + currency.format(P) + "\n");
P = P + interestAccrued - M;
public void itemStateChanged(ItemEvent ie)
{ int status = ie.getStateChange();
if (status == ItemEvent.SELECTED)
mortgage.setEnabled(false);
YR.setEditable(true);
RT.setEditable(true);
Cal.setEnabled(true);
else
mortgage.setEnabled(true);
YR.setEditable(false);
RT.setEditable(false);
Cal.setEnabled(false);
public void actionPerformed(ActionEvent ae)//Calculations and Button executions
String command = ae.getActionCommand();
// Exit program
if (command.equals("Exit"))
System.exit(0);
// Cal button
if (command.equals("Calculate") || command.equals("mortgage"))
calculate();
// Clear fields
if (command.equals("Clear"))
money.setText(null);
mortgage.setSelectedIndex(3);
owe.setText(null);
chart.setText(null);
} //End actionPerformed
public static void main(String args[]) throws IOException
new CalcTest();
[/Code]Here is the code again
import java.io.;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.NumberFormat;
import java.math.*;
public class CalcTest extends JFrame implements ActionListener, ItemListener
public JMenuBar createMenuBar()
JMenuBar mnuBar = new JMenuBar();
setJMenuBar(mnuBar);
//Create File & add Exit
JMenu mnuFile = new JMenu("File", true);
mnuFile.setMnemonic(KeyEvent.VK_F);
mnuFile.setDisplayedMnemonicIndex(0);
mnuBar.add(mnuFile);
JMenuItem mnuFileExit = new JMenuItem("Exit");
mnuFileExit.setMnemonic(KeyEvent.VK_F);
mnuFileExit.setDisplayedMnemonicIndex(1);
mnuFile.add(mnuFileExit);
mnuFileExit.setActionCommand("Exit");
mnuFileExit.addActionListener(this);
JMenu mnuFunction = new JMenu("Function", true);
mnuFunction.setMnemonic(KeyEvent.VK_F);
mnuFunction.setDisplayedMnemonicIndex(0);
mnuBar.add(mnuFunction);
JMenuItem mnuFunctionClear = new JMenuItem("Clear");
mnuFunctionClear.setMnemonic(KeyEvent.VK_F);
mnuFunctionClear.setDisplayedMnemonicIndex(1);
mnuFunction.add(mnuFunctionClear);
mnuFunctionClear.setActionCommand("Clear");
mnuFunctionClear.addActionListener(this);
// Fields for Principle
JPanel row1 = new JPanel();
JLabel dollar = new JLabel("How much are you borrowing?");
JTextField money = new JTextField("", 15);
// Fields for Term and Rate
JPanel row2 = new JPanel();
JLabel choice = new JLabel("Select Year & Rate:");
JCheckBox altchoice = new JCheckBox("Alt. Method");
JTextField YR = new JTextField("", 4);
JTextField RT = new JTextField("", 4);
//Jcombobox R=rate,Y=year
String[] RY = {
"7 years at 5.35%", "15 years at 5.5 %", "30 years at 5.75%", " "
JComboBox mortgage = new JComboBox(RY);
// Fields for Payment
JPanel row3 = new JPanel();
JLabel payment = new JLabel("Your monthly payment will be:");
JTextField owe = new JTextField(" ", 15);
//Scroll Pane and Text Area
JPanel row4 = new JPanel();
JLabel amortization = new JLabel("Amortization:");
JTextArea chart = new JTextArea(" ", 7, 22);
JScrollPane scroll = new JScrollPane(chart, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
StringBuffer amt = new StringBuffer();
Container pane = getContentPane();
FlowLayout flow = new FlowLayout(FlowLayout.LEFT);
JButton Cal = new JButton("Calculate");
NumberFormat currency = NumberFormat.getCurrencyInstance();
public CalcTest()
// Title and Exit of JFrame
super("Mortgage and Amortization Calculator");
setSize(475, 328);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//JFrame layout
pane.setLayout(flow);
//Input output fields added to JFrame
row1.add(dollar);
row1.add(money);
pane.add(row1);
mortgage.setSelectedIndex(3);
mortgage.addActionListener(this);
mortgage.setActionCommand("mortgage");
row2.add(altchoice);
altchoice.addItemListener(this);
row2.add(choice);
YR.setEditable(false);
RT.setEditable(false);
row2.add(YR);
row2.add(RT);
row2.add(mortgage);
pane.add(row2);
row3.add(payment);
row3.add(owe);
pane.add(row3);
owe.setEditable(false);
//Scroll Pane added to JFrame
row4.add(amortization);
chart.setEditable(false);
row4.add(scroll);
pane.add(row4);
//Executable Button- Clear,Exit, Calculate
JPanel row5 = new JPanel();
JButton clear = new JButton("Clear");
clear.addActionListener(this);
row5.add(clear);
pane.add(row5);
JButton exit = new JButton("Exit");
exit.addActionListener(this);
row5.add(exit);
Cal.setEnabled(false);
Cal.addActionListener(this);
row5.add(Cal);
pane.add(row5);
setContentPane(pane);
setVisible(true);
} //End of constructor
private void calculate()
String loanAmount = money.getText();
if(loanAmount.equals(""))
return;
double P = Double.parseDouble(loanAmount);
int y;
double r;
if(altchoice.isSelected())
if(YR.getText().equals("") || RT.getText().equals(""))
return;
y = Integer.parseInt(YR.getText());
r = Double.parseDouble(RT.getText());
else
int index = mortgage.getSelectedIndex();
if(index == 3)
return;
int[] terms = { 7, 15, 30 };
double[] rates = { 5.5, 5.35, 5.75 };
y = terms[index];
r = rates[index];
double In = r / (100 * 12.0);
double M = P * (In / (1 - Math.pow(In + 1, -12.0 * y)));
owe.setText(currency.format(M));
//Column Titles for Text Area
chart.setText("Pmt#\tPrincipal\tInterest\tBalance\n");
for (int i = 0; i < y * 12; i++)
{ double interestAccrued = P * In;
double principalPaid = M - interestAccrued;
chart.append(i + 1 + "\t" + currency.format(principalPaid)
+ "\t" + currency.format(interestAccrued)
+ "\t" + currency.format(P) + "\n");
P = P + interestAccrued - M;
public void itemStateChanged(ItemEvent ie)
{ int status = ie.getStateChange();
if (status == ItemEvent.SELECTED)
mortgage.setEnabled(false);
YR.setEditable(true);
RT.setEditable(true);
Cal.setEnabled(true);
else
mortgage.setEnabled(true);
YR.setEditable(false);
RT.setEditable(false);
Cal.setEnabled(false);
public void actionPerformed(ActionEvent ae)//Calculations and Button executions
String command = ae.getActionCommand();
// Exit program
if (command.equals("Exit"))
System.exit(0);
// Cal button
if (command.equals("Calculate") || command.equals("mortgage"))
calculate();
// Clear fields
if (command.equals("Clear"))
money.setText(null);
mortgage.setSelectedIndex(3);
owe.setText(null);
chart.setText(null);
} //End actionPerformed
public static void main(String args[]) throws IOException
new CalcTest(); -
My iPod Classic 120GB makes a clicking noise when syncing with iTunes and will not sync. It will not turn on at this time and has been charged but does not hold the charge. After trying to sync, iTunes states that iPod must be restored. Have tried to do this but not successful, I receive an error code and have done the troubleshooting steps for the error and I am still not able to sync or use my iPod. HELP?
Hi mafiose15,
Thanks for visiting Apple Support Communities.
Restoring your iPod to factory settings is the best way to try and get it back to working order. You can use the instructions below to restore it:
How to restore iPod
Verify that you have an active Internet connection, because you may need to download new versions of the iTunes and iPod Software.
Download and install the latest version of iTunes if necessary.
Open iTunes. Connect your iPod to your computer using the USB or FireWire cable that came with your iPod.
After a few moments, your iPod will appear in the Source panel in iTunes.
Select your iPod in the Source panel. You will see information about your iPod appear in the Summary tab of the main iTunes window.
Click Restore.
If you are using a Mac, you will be asked to enter an administrator’s name and password.
A progress bar will appear on the computer screen, indicating that stage one of the restore process has begun. When this stage is done, iTunes will present one of two messages with instructions specific to the iPod model you are restoring.
Disconnect iPod and connect it to iPod Power Adapter (typically applies to older iPod models).
Leave iPod connected to computer to complete restore (typically applies newer iPod models).
During stage two of the restore process, the iPod displays an Apple logo as well as a progress bar at the bottom of the display. It is critical that the iPod remain connected to the computer or iPod power adapter during this stage.
Note: The progress bar may be difficult to see, because the backlight on the iPod display may be off.
After stage two of the restore process is complete, the iTunes Setup Assistant window will appear. It will ask you to name your iPod and choose your syncing preferences, as it did when you connected your iPod for the first time.
You can find the instructions in this article:
Restoring iPod to factory settings
http://support.apple.com/kb/ht1339
All the best,
Jeremy -
After updating iTunes this week Windows 8 recognizes the iPod but does not offer an option to open with iTunes. iTunes does not recognize iPod Touch. Have followed all the steps but without success. Is there a solution with iTunes?
I followed all the instructions on the suggested page. Many files in C:\Program Files\Common Files\Apple\ and C:\Program Files (x86)\Common Files\Apple\ could not be deleted. Message said ""Cannot delete files: It is being used by another person or program"' but could not find iPodService.exe in task manager (also, the "Cannont delete ... " did not mention iPodService.exe).
Deleted all that I could. Reinstalled iTunes. Still same result. iTunes and computer both recognize my old iPod. Only the computer recognizes iPod Touch. -
Successfully downloaded os x lion, but does not show as installed
Bought and successively downloaded os x lion on my Mac, but does not show as installed
That's one of the confusing things about the App store. The app you purchase there is the Installer.
If you've successfully run the installer then your Mac is on Lion but the last step of the install proceedure deletes the Installer from your apps directory. The App store then reflects that the Installer is not installed on the system.. which is true.
You can redownload the installer from the app store if needed. If the installer is still in the Apps directory then you probably haven't installed Lion yet, just downloaded it.
Regards,
Captfred
Maybe you are looking for
-
CS5.5 Download hang at ~50%
Hello, I'm trying to download CS5.5 design premium trial, but the adobe dowloader hang at ~50%, the size of file created is 4.080.784Kb. I've tried 5 times to download this, and it always hang at ~50%. Is it really possible to download it? Isn't it p
-
What is wrong with my site that it is not like I've created?
what is wrong with my site that it is not like I've created? The button will automatically be bigger. http://www.tomisha.com/muse
-
How do i change my sync settings on itunes so i can pick what songs i want to sync
i have a new macbook pro, the first time i synced my iphone to my itunes i selected sync auto. now i want to change my settings to sync music i select. but when i plug my iphone in the icon that pops up in itunes is only a eject thing. theres no cli
-
Can a 200 mb pdf nitro be converted in word document in trial version of acrobat XI pro
can a 200 mb pdf nitro be converted in word document in trial version of acrobat XI pro
-
Hello! I have a Quicktime file that plays on a computer that runs Quicktime 7.6.4. When I try to play it on my computer, which has both Quicktime X and Quicktime 7.6.3, it won't open. QT 7.6.3 opens the file but there's no video, just audio. QT X say