Ora 01858 through Java code
In a very peculiar condition the following code gives ora-01858(a non-numeric character was found where a numeric was expected) in one environment whereas it doesnt give in other environment.
In Environment 1
DEBUG - %%%%%%%% sbSQLDetailsMbrLp==select TB_TRS_LP.MKT_BID_RATE, PUBLISH_DT from TB_TRS_LP where TB_TRS_LP.SWIFT_CCY_CODE='HKD' and TB_TRS_LP.TENOR='O/N' and TO_DATE(TB_TRS_LP.PUBLISH_DT,'dd/MM/YYYY hh:mi:ss AM') <= TO_DATE('', 'dd/MM/YYYY hh:mi:ss AM') AND BKG_CODE='SIN' ORDER BY PUBLISH_DT DESC
ERROR - Exception: java.sql.SQLException: ORA-01858: a non-numeric character was found where a numeric was expected
ERROR - Exception: com.pbg.eplatform.exception.CDBException: Problem occured in DAO(CShowCustomerInterestRateDAO) due to SQLException!
Exception Raised - ORA-01858: a non-numeric character was found where a numeric was expected
In Environment 2 this goes perfectly fine. We are using Weblogic JDBC. If we execute the same query outside java code, the sql does nt throw any errors.
Any known issues or anybody who have come across this problem. please throw some light.
The oracle versions between environment 1 and 2 are as follows.
In Environment 1
SQL> select * from v$version;
BANNER
Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
PL/SQL Release 8.1.7.2.0 - Production
CORE 8.1.7.0.0 Production
TNS for Solaris: Version 8.1.7.2.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
SQL>
In Environment 2
SQL> select * from v$version;
BANNER
Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
PL/SQL Release 8.1.7.0.0 - Production
CORE 8.1.7.0.0 Production
TNS for 32-bit Windows: Version 8.1.7.0.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
SQL>
The answer is to extract the EXE into a temp directory, execute it, and delete it when you're done. For example:
//This is the path *inside* the JAR file!
InputStream in = getClass().getResourceAsStream("/resources/myprog.exe");
OutputStream out = new FileOutputStream("myprog.exe");
File file = new File("myprog.exe");
int data;
while((data = in.read()) >= 0) out.write(data);
in.close();
out.close();
//Execute the EXE here using java.lang.Runtime.exec()
if(file.exists()) file.delete();
...
Similar Messages
-
Running windows command through java code
Hello
i want to execute jar.exe through java code , i have written following piece of code , but it isn't working
ProcessBuilder processBuilder = new ProcessBuilder(new String[]{"cmd.exe","/c","%java_home%\\bin\\jar.exe"});
Process process = processBuilder.start();
BufferedReader inputReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
String line = inputReader.readLine();
while(line != null){
System.out.println(line);
line = inputReader.readLine();
does anybody knows why
Regards
Edited by: Mayur Mitkari on Mar 5, 2013 10:19 PM
Edited by: Mayur Mitkari on Mar 5, 2013 10:20 PM
Edited by: Mayur Mitkari on Mar 5, 2013 10:20 PMsorry for that , but the
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec(new String[]{"cmd.exe","/c","jar"});
proc.waitFor();
int i = proc.exitValue();
this code was different from first one
and in case of Process if runtime .exec is succesful it is wainting for long time , in this case i want if the runtime.exec is succesful something should be returned
Regards -
Adding rows to J2ME WTK/Settings/User Defined (through Java code)
Hi all..
Just a quick question..
Is it possible to add Key/Value pairs to a MIDlet's 'User Defined' field through Java code..(ie) - add a new row to the User Defined field..
If not, can anyone tell me how a Bluetooth-Client GUI can save an image it has been sent by a Bluetooth-Server GUI?
Thanks in advance..
Rookieif i understand you, you want to call application module method when user clicks on add button on the UI and your table is from VO
so what i can come up for now is:
1) create variable binding from the iterator for both name and price.
2) on your UI action button :
<af:commandButton actionListener="yourbean.addToCart">
<f:attribute name="pName" value ="binding.<created name bind variable>"
<f:attribute name="pPrice" value = "binding.<created price bind variable>"
</af:commandButton>
3) custom Managed Bean:
//yourBean.java
public void addToCart(ActionEvent e){
// get binding here
// use executeWitParams method to send parameter to the function "testMethod" and execute
//AppModuleImp.java
public void testMethod(String pName,String pPrice) {
CardVOImpl vo = this.getCartVO1();
CardVORowImpl r = (CardVORowImpl)vo.createRow();
r.setAttribute("NAME", pName);
r.setAttribute("PRICE", pPrice);
vo.insertRow(r);
Hope this helps...
Let me know if not..
Thanks
Edited by: MavenDev on Oct 30, 2011 8:08 PM -
How to Increase Java Heap Size through Java Code. Increase inside Code?
Hi All,
I am using a third party tool. When i run a particular program it says OutOfMemory error. I like to increase heap size through Java Code before calling the particular Java application or Code..
Is there is any way to set the Heap Size through Java Code in run time ???
Pls Kindly help.
Thanks.if you start the program with a -Xmx512m flag, the virtual machine gets half a gigabyte of memory to use (or that's the max it's allowed to use). All things run in the same virtual machine will have the same limit, third party tools run in the same virtual machine can't "not care about this" unless they're throwing OOMs themselves for some stupid reason.
-
How do I trigger an Oracle report through Java Code?
Hello,
I am new to reports. Is there any way to trigger a report through java code - I know there is an OS command to trigger a report automatically. Has anybody done this through a high level PL?
AmitWe are in a similar situation. If you receive any answers can you forward the same to [email protected]
-
Problem with executing shell script on linux through java code.
i am facing problem to kill jboss process on linux that is my application requirement. for that i created one shell script that will get all the process for jboss instance and kill them when i am running that script from command prompt on linux its working perfectly.
The command i am using ---
/opt/RW9/jboss/v4.0.5.GA/bin/restartjboss.sh.
but when i am running through java code its not working.
the java code i am using is:-
pp = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", "/opt/RW9/jboss/v4.0.5.GA/bin/restartjboss.sh"});
could anyone tell me what is the problem ?
Edited by: akm198110 on Sep 2, 2008 9:24 AMI got the problem after long struggle ,after doing proper path i am able to execute the shell script..
-
How to find IP allocated to windows OS through java code
Hi,
I want to find no of IPs allocated to windows OS through java code. How i can do this.Please give me idea.
any help will be appricated.
Thanks in advance
Ravi AdhaYou can use the InetAddress class in the java.net package to find all the IP addresses of your computer.
-
Need to track windows processes through java code.
Need to track windows processes through java code.
Eg: I want to find out whether an exe file (wrun.exe) is running or stopped.
Can I do it through java. If so can any one please tell me how to do it. That will be a great help.
Thanks,
RameshThere are 2 options for things like this:
1) Use Runtime.exec() to execute some command or application and parse the input from it.
2) Write some native code and use JNI to call it. -
Setting java_home through java code
Hello , i went through lots of information for setting java_home through java code but i was unable to find any useful information, does anybody know how to set java home through java code
Regards
Mayur MitkariThe question doesn't make any sense to me. If Java needs the JAVA_HOME variable set, how is it ever going to execute any code that does so? And if it doesn't need it, why set it?
-
Opening a word file in MS Office Word software window through Java code
I want to open a word file in MS Office Word software window through Java code.
Is it possible ? If possible then please let me now how can I do it.
BhoopenderThanks for replying.
I tried the following code -
public class OpenFileWithItsExt
public static void main(String[] args) throws java.io.IOException
Runtime.getRuntime().exec("a.doc");
and it gets compiled successfully, but on running outputs as -
Exception in thread "main" java.io.IOException: CreateProcess: a.doc error=193
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:428)
at java.lang.Runtime.exec(Runtime.java:364)
at java.lang.Runtime.exec(Runtime.java:326)
at OpenFileWithItsExt.main(OpenFileWithItsExt.java:5)
My file is in the pesent working directoty.
Please solve my problem.
Thanks -
Change the Summary Attribute Value through Java code
Hi ,
I am working on a requirement where I need to set the Attribute value on the final Summary Screen through Java Code.
Code :
InterviewUserData data = new InterviewUserData();
InterviewEntityInstance globalInstance = data.getGlobalInstance();
globalInstance.setValue("Name", value_to_set);
On completion of the interview session Name is displaying as NULL.
I need to set NAME = value_to_set and display it on the final summary screen.
Any help on this will be appreciated.
RegardsThe InterviewUserData object is effectively a change set, to apply this to a session you use the InterviewSession.submit(InterviewUserData) method. You don't say how you are invoking this code but if it's inside an event Interview Engine handler the InterviewSession object should be accessible.
Regards
Ian -
How to update OID oblogintrycout attribute through java code
Hi Team,
As per my requirement ,i need to update OID oblogintrycout attribute through java code. could you please help me on this.
where can i get the java code.
Regards,
Ravi.As always, Google is your friend.
Follow the bouncing link.
http://www.google.com/search?hl=en&q=VisualSourceSafe+%2B+Java+API
PS. -
Getting problem when connecting to SMTP server through java code
Hi all,
I am getting problem when i am going to connect with "Kerio SMTP server" through java code. The error what i am getting is :
"[16/Sep/2008 15:59:09] Sent: Queue-ID: 48cf8a73-000000f9, Recipient: <[email protected]>, Result: failed, Status: 5.3.2 554 5.0.0 Too many hops (101, max 100), message looping" when sending an email from [email protected]Looks like something is set up wrong on your server that's causing messages
to be forwarded around a loop too many times without ever reaching the destination.
For instance, if server A forwards to server B, and server B forwards to server A,
this would happen. -
Passing parameters to Widgets through Java code
hi,
i want to pass parameters to yahoo widgets through java code. Eg, if we consider yahoo weather widget, then i have to pass the parameters country through java code. i also have to read the output given by widget through java code (which in this case is the weather for all the days for the current week).
This is an extremely urgent requirement, so quick and helpful reply will be highly appretiated.
thanks in advanceHello,
Did you try passing through the URL
eg: http:
test.html?a="test"; and use some request open to get the values from the url.
HTH
Vivek Nidhi -
Startup/Shutdown database through java code
I am trying to shutdown/startup my database 10gr2 using a java code.
I am able to shutdown db through EM dbconsole .. so there should be way to perform these steps using java prog.
Issue I am getting is that "shutdown immeidate" is not a valid sql statement.
do "shutdown" command strickly belongs to sqlplus only
[ shutdown/ shutdown immeidate/shutdown abort ] .. nothing works
Error is
Connected ..
Shuting down database..
java.sql.SQLException: ORA-00900: invalid SQL statement
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
Any idea how we can achive it
here ismy code ..
======================
/* shutdown/startup database */
import java.sql.*;
import oracle.jdbc.driver.*;
class DBTest
public static void main (String args[])
Connection connection = null;
try {
// Load the JDBC driver
String driverName = "oracle.jdbc.driver.OracleDriver";
Class.forName(driverName);
// Create a connection to the database
String serverName = "127.0.0.1";
String portNumber = "1521";
String sid = "prod";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
String username = "sys as sysdba";
String password = "password";
connection = DriverManager.getConnection(url, username, password);
System.out.println("Connected ..");
System.out.println("Shuting down database..");
Statement stmt = connection.createStatement();
stmt.execute("shutdown immediate");
stmt.close();
System.out.println("Shuting down database complete..");
connection.close();
} catch (ClassNotFoundException e) {
e.printStackTrace();
// Could not find the database driver
} catch (SQLException e) {
e.printStackTrace();
// Could not connect to the database
==================================Link is perfect for OCI users.
Do anyone have an idea how 10g enterprise manager console stops database server. Whats happening in background when shutdown button is clicked after provided database and host credential.
Maybe you are looking for
-
Upload data eCATT in ECC6 vs 4.7
HI There, I uploaded MM data in ECC6 before by using CATT (record scripts and load in configuration) but yesterday I was using someone's 4.7 IDES and surprisingly stuck. Scenario: In Ecc6 After recording script, creat test configuration and on varian
-
Deliveries using movement type 161
Hi experts: I am working with an escenario with movement type 161, the process flow is the next: 1. In transaction MB01, I create document material with movement 161, there isn´t purchase order (returns) 2. When I create document material, the system
-
Torch9800 Picture & Video not saving correctly
I updated the software on my phone a few weeks ago, which resulted in the phone turning itself off constantly. I resolved this issue. However, when I take a picture it looks as if its saved, but when I go to the media files a little later all I see i
-
Unable to open MOST Pages documents
Help! I use Pages to create invoices; I went to create an invoice today and Pages just sits there, not responding. I've had to Force-quit everytime I try to open one of my previous invoice documents or almost any other document (please note-there is
-
Hi guys, I'm a having a little trouble getting my site XHTM Transitional validated. Im getting about 50 errors using W3's HTML validator. I don't understand how Dreamweaver allows so many errors and they don't show up and it's in built validator? I'v