Problem Executing OracleConnectivity.jar
hi,
I have a strange problem when i execute the code (java OracleConnectivity) it works fine, but when i make its jar file and execute it (java -jar OracleConnectivity.jar) it throws exception
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at OracleConnectivity.main(OracleConnectivity.java:8)
here goes the code
import java.sql.*;
import oracle.jdbc.driver.*;
public class OracleConnectivity
public static void main(String[] args)
try{
Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@172.16.172.221:1521:dbsettle","settlement","settlement");
Statement stm = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stm.executeQuery("SELECT * FROM rm_number_location_t");
while(rs.next())
System.out.println(rs.getString("RM_LOCATION_NUMBER_PREFIX"));
}catch(Exception e){e.printStackTrace();}
my class path is
F:\jdk1.4\jre\lib\rt.jar;F:\jdk1.4\lib\tools.jar;F:\jdk1.4\jre\lib\ext\comm.jar;C:\Documents and Settings\gohar\Desktop\stuff\wma-1_1-src-windows-i686RI\wma1.1fcs\lib;F:\jdk1.4\jre\lib\ext\classes12.zip;F:\jdk1.4\bin;
the code works even if i dont import
import oracle.jdbc.driver.*;
any slutions , thanks in advance.
for class file
java OracleConnectivity
for jar file
java -jar OracleConnectivity.jar
I have worked around the problem.I made a .bat file syntax
java OracleConnectivity
and it works fine
But still i cant get that why jar file was throwing Exception
Similar Messages
-
Problems executing my jar file
i wanted to ask how do you jar a file and make it executable at the same
time
i did something like this
jar cfm main.jar Manifest.txt House.class mainInteractiveMap.class
house.jpg car.jpg map1.txt
and in the manifest file i have soemthing like this
Main-Class: MainInteractiveMap
but when i try to run it like this
java -jar main.jar
it gives me an error like this
exception in thread main java,lang.NoClassDefFoundError:
MainInteractiveMap
but the main is in MainInteractiveMap
regards1. Does your application run when do not jar it? If it does run, what command do you use? If it doesn't run, get it to run before you try to jar it.
2. Does your application run using
java -cp main.jar MainInteractiveMapIf it doesn't run, you have not jared the MainInteractiveMap correctly. If it does run, then you have a problem in the manifest. For example, there should be a blank line at the end of the Manifest.txt line. -
Problem executing .jar file
My program was runnable before by executing the jar file and it doesn't work for some reason now. My manifest file is shown below. The error it gives is "Can't find main class, program will exit". Have I declared my main class wrong or something? It worked fine earlier.
Manifest-Version: 1.2
Main-Class: DHolidaysDatabase_SWiNG/SWDHolidays
Name: DHolidaysDatabase_SWiNG/Setting.java
Java-Bean: False
Digest-Algorithms: SHA MD5
SHA-Digest: oWg6g03EbjaxldIbXSrTD72js3A=
MD5-Digest: wcAFPTlHlvUxF0EqC7xyaw==
Name: DHolidaysDatabase_SWiNG/SWDHolidays.java
Java-Bean: False
Digest-Algorithms: SHA MD5
SHA-Digest: oWfxPN8XfEwj9XVbud5ga0JNJp8=
MD5-Digest: d8GH20JQt+46GDTNEJ66Gw==
Name: DHolidaysDatabase_SWiNG/Booking.java
Java-Bean: False
Digest-Algorithms: SHA MD5
SHA-Digest: XQ8yb35VKGudeY3F6wAeAZUneoc=
MD5-Digest: W9gN8T6hR0X1pMhNwowrQQ==
Name: DHolidaysDatabase_SWiNG/Itinerary.java
Java-Bean: False
Digest-Algorithms: SHA MD5
SHA-Digest: 1IrzPAHQZPU/O8YYytImJRMNs48=
MD5-Digest: QzpFCTfG2i/C27wMdLQLIw==
Name: DHolidaysDatabase_SWiNG/
Sealed: True
Name: DHolidaysDatabase_SWiNG/Stop.java
Java-Bean: False
Digest-Algorithms: SHA MD5
SHA-Digest: kSaxqmDnhm5IcnQFuy43NKN1BmA=
MD5-Digest: h9VwllxGY+PFAJJMyElOQQ==
Name: DHolidaysDatabase_SWiNG/HotelDataManager.java
Java-Bean: False
Digest-Algorithms: SHA MD5
SHA-Digest: zUs+YJsPGVFAaezdIpvTSeKPsZo=
MD5-Digest: gDkFwZczx3w99Gar4NS3sQ==
Name: DHolidaysDatabase_SWiNG/DBaseException.java
Java-Bean: False
Digest-Algorithms: SHA MD5
SHA-Digest: nD5NlvfB7t6O8Z81kZEMK2qXeyI=
MD5-Digest: +3YHy7dGiJAK5LLHiEQViQ==
Name: DHolidaysDatabase_SWiNG/Hotel.java
Java-Bean: False
Digest-Algorithms: SHA MD5
SHA-Digest: 1QTjvzw4Qnm0JuMJbeTmEJmSjd4=
MD5-Digest: 8eU7VibFyYLk4CdOH436gg==main-class header should have a class name.
Main-Class: DHolidaysDatabase_SWiNG.SWDHolidays -
How to execute a jar file in a java application
Hi,
I've already try to execute a jar file by this way :
Runtime.getRuntime().exec(java -jar myJarFile.jar);
But the problem is that the display doesn't launch. Normally a "JFrame" display.
however the corresponding process is launched.
So i would to know if there is a way to execute a Jar File without using the Runtime class.
Is there a specific class for the Jar File?
Thank you.
RichardCreate a 'manifest' file pointing to the 'main' class, jar it into the .jar file, place it onto your desktop - or whereever you can click on it, and click on it.
-
How can i execute a .jar or .jad through java?
I want to execute a .jar like i do in SE using the class RunTime in ME does anybody know how can i do it? There is no method exec in MIDP Runtime API
I have a MIDlet that receives a jar file from another PDA using DatragramConection and FileConnection. It's working well. When i'm running my application i'll send the jar file to another aplication and this application should receive, execute and return the result. For example, if i have a simple program that prints Hello World. I'll send the program the other PDA will execute and then return a String. I have to call the jr file through java because my MIDlet wil be already running.
Could you understand my problem? -
Performance problem with ojdbc14.jar
Hi,
We are having performance problem with ojdbc14.jar in selecting and updating (batch updates) entries in a table. The queries are taking minutes to execute. The same java code works fine with classes12.zip ans queries taking sub seconds to execute.
We have Oracle 9.2.0.5 Database Server and I have downloaded the ojdbc14.jar from Oracle site for the same. Tried executing the java code from windows 2000, Sun Solaris and Opteron machines and having the same problem.
Does any one know a solution to this problem? I also tried ojdbc14.jar meant for Oracle 10g, that did not help.
Please help.
Thanks
YuvaMy code is doing some thing which might be working well with classes12.zip and which does not work well with ojdbc14.jar? Any general suggestions to make the code better, especially for batch updates.
But for selecting a row from the table, I am using index columns in the where cluase. In the code using PreparedStatement, setting all the reuired fields. Here is the code. We have a huge index with 14 fields!!. All the parameters are for where clause.
if(longCallPStmt == null) {
longCallPStmt = conn.prepareStatement(longCallQuery);
log(Level.FINE, "CdrAggLoader: Loading tcdragg entry for "
+GeneralUtility.formatDate(cdrAgg.time_hour, "MM/dd/yy HH"));
longCallPStmt.clearParameters();
longCallPStmt.setInt(1, cdrAgg.iintrunkgroupid);
longCallPStmt.setInt(2, cdrAgg.iouttrunkgroupid);
longCallPStmt.setInt(3, cdrAgg.iintrunkgroupnumber);
longCallPStmt.setInt(4, cdrAgg.iouttrunkgroupnumber);
longCallPStmt.setInt(5, cdrAgg.istateregionid);
longCallPStmt.setTimestamp(6, cdrAgg.time_hour);
longCallPStmt.setInt(7, cdrAgg.icalltreatmentcode);
longCallPStmt.setInt(8, cdrAgg.icompletioncode);
longCallPStmt.setInt(9, cdrAgg.bcallcompleted);
longCallPStmt.setInt(10, cdrAgg.itodid);
longCallPStmt.setInt(11, cdrAgg.iasktodid);
longCallPStmt.setInt(12, cdrAgg.ibidtodid);
longCallPStmt.setInt(13, cdrAgg.iaskzoneid);
longCallPStmt.setInt(14, cdrAgg.ibidzoneid);
rs = longCallPStmt.executeQuery();
if(rs.next()) {
cdr_agg = new CdrAgg(
rs.getInt(1),
rs.getInt(2),
rs.getInt(3),
rs.getInt(4),
rs.getInt(5),
rs.getTimestamp(6),
rs.getInt(7),
rs.getInt(8),
rs.getInt(9),
rs.getInt(10),
rs.getInt(11),
rs.getInt(12),
rs.getInt(13),
rs.getInt(14),
rs.getInt(15),
rs.getInt(16)
}//if
end_time = System.currentTimeMillis();
log(Level.INFO, "CdrAggLoader: Loaded "+((cdr_agg==null)?0:1) + " "
+ GeneralUtility.formatDate(cdrAgg.time_hour, "MM/dd/yy HH")
+" tcdragg entry in "+(end_time - start_time)+" msecs");
} finally {
GeneralUtility.closeResultSet(rs);
GeneralUtility.closeStatement(pstmt);
Why that code works well for classes12.zip (comes back in around 10 msec) and not for ojdbc14.jar (comes back in 6-7 minutes)?
Please advise. -
How can execute a jar application
Hello there, I am facing problem with executing jar application. How can I execute a jar application using java program.
Thanks & RegardsVINAY_Kr_SHARMA wrote:
...How can I execute a jar application using java program.Do you mean:
a) You have a Java application on-screen, and you want it to be able to launch other Jars that are not part of the current Java application?
b) You want to know how to run a Jar in the Java plug-in? -
Exception is thrown only while executing the jar file
java.lang.NoClassDefFoundError: javax/mail/Address Exception is thrown only while executing the jar file. But the program compiles and executes good when executed for command prompt through the class files.
I used javamail API in my program. Classpath and every others are set to the right one's. Executed fine when used java Random.class. But the problem is only with the jar file.
Please help me out in this regard. Why the exception is thrown only in jar but not at class level.Assuming you're running your program using "java -jar", your jar file needs a Class-Path entry
in the manifest file that references mail.jar. -
Problems with client.jar - generated from webservices toolkit from JDK 1.1.7
We have deployed a web application using the webservices in WL 6.1 using JDK 1.3.1.
The clients were able to successfully access the servlet it generated and download
the client.jar. Unfortunately this client.jar seems to be dependent on JDK 1.2
and beyond. It seems to use java.util.Map class in the JNDI-SOAP SPI.
Is there any workaround or fix to this problem, so this jar can be used from a
JDK 1.1.7 env?.
Our objective is to use WL 6.1 EJB's from WL 4.5.1 using Webservices. Are there
any known problems with this approach (Ofcourse other than this).
Thank you.
Dora Potluri
Here is the stack trace from using the client.jar
Class not found java.lang.ClassNotFoundException: java.util.Map
[Root exception is java.lang.ClassNotFoundException: java.util.Map]javax.naming.
NamingException: Class not found java.lang.ClassNotFoundException: java.util.Map
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at javax.naming.NamingException.<init>(Compiled Code)
at weblogic.soap.http.SoapContext.throwNamingException(Compiled Code)
at weblogic.soap.http.SoapContext.lookup(Compiled Code)
at javax.naming.InitialContext.lookup(Compiled Code)
at weatherEJB.WeatherBean.getTemp(Compiled Code)
at weatherEJB.WeatherBeanEOImpl.getTemp(Compiled Code)
at weatherEJB.WeatherBeanEOImpl_WLSkel.invoke(Compiled Code)
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(Compiled Code
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(Compiled
Co
de)
at weblogic.rmi.extensions.BasicRequestDispatcher$BasicExecuteRequest.ex
ecute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Fri Sep 21 10:47:12 CDT 2001:<I> <EJB> Transaction: '1001087185816_1' rolled bac
k due to EJB exception:Yes, there is an expectation that the client jar will be run on JDK 1.3x. WLS 6.1 is certified on JDK 1.3x only. This
applies to the WebServices client as well. For details on platform support see
http://e-docs.bea.com/wls/platforms/index.html
Thanks,
Jim
Jim Rivera
Product Manager, WebLogic Server
BEA Systems, Inc.
Dora Potluri wrote:
I started testing using the client.jar generated by webservices WL 6.1 and found
that it uses reflection API interfaces that are not available til JDK 1.3. Is
there an expectation that the clients of Webservices are all going to be JDK 1.3.X.
Here is the stack trace we get.
java.lang.NoClassDefFoundError: java/lang/reflect/InvocationHandler
at weblogic.soap.http.SoapContext.lookup(SoapContext.java:76)
at javax.naming.InitialContext.lookup(InitialContext.java:280)
at weatherEJB.WeatherBean.getTemp(WeatherBean.java:106)
at weatherEJB.WeatherBeanEOImpl.getTemp(WeatherBeanEOImpl.java:47)
at weatherEJB.WeatherBeanEOImpl_WLSkel.invoke(WeatherBeanEOImpl_WLSkel.java:90)
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java:261)
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:56)
at weblogic.rmi.extensions.BasicRequestDispatcher$BasicExecuteRequest.execute(BasicRequestDispatcher.java:166)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code) -
Problem executing .bat file from within Java class
I'm stumped: I have no problem executing a .bat file that sets classpaths and executes a Java jar, but when I try to execute other executables first and then the .jar, my application hangs and since the DOS box doesn't come up over my GUI, I can't see what's going on.
This works:
public void execute() throws Exception {
String s = "c:\\cs47auxs\\omnijar\\omni.bat";
Process p = Runtime.getRuntime().exec("\"" + s + "\"");
p.waitFor();
JOptionPane.showMessageDialog(frame,
"The Database Has Been Successfully Reloaded.",
"Information Message",
JOptionPane.INFORMATION_MESSAGE);
Here's the .bat 'omni.bat'
set JAVA_HOME=c:\j2sdk1.4.2_04\bin
%JAVA_HOME%\java -jar C:\CS47AUXS\OMNILOADJAR\OmniLoad.jar
This doesn't work:
public void execute() throws Exception {
String s = "c:\\cs47auxs\\omnijar\\jobomni.bat";
Process p = Runtime.getRuntime().exec("\"" + s + "\"");
p.waitFor();
JOptionPane.showMessageDialog(frame,
"The Database Has Been Successfully Reloaded.",
"Information Message",
JOptionPane.INFORMATION_MESSAGE);
Here's the .bat file 'jobomni.bat'
SET NETX_HOME=C:\CS47AUXS
SET COBOL_HOME=C:\CS47AUXS\OFFLINE
CD %NETX_HOME%
CALL SET-NETX.CMD
CD %COBOL_HOME%
SSBPPC10 JOBOMNI X
SET JH=C:\J2SDK1.4.2_04\BIN
SET OMNI_HOME=C:\CS47AUXS\OMNILOADJAR
CD %OMNI_HOME%
%JH%\java -jar omniload.jar
Can anyone shed some light here? Even when I execute the application from the command line the new DOS box doesn't become visible nor can I see any errors. If I could just get that visibility, I could probably figure out what is going wrong.Same problem with me as well.... Badly looking for a solution...
I predict the following:
- If your batch file has pretty less number of dos/shell commands then it gets executed fine with exec() and proc.waitFor();
- If you increase the number of dos/shell commands in the bat file then try executing it then it definately hangs at proc.waitFor();
Even "cmd.exe /C C:\\test.bat" hangs... if the commands are more...
Is this some sort of bug? or am i doing anything wrong? I tried searching for solution on the net and search forums... but couldnt find a solution for the same.. not sure where i missed, what i missed...
Incase some one finds a solution.. do post it here...
Message was edited by:
amadas -
How to execute a jar file which has an applet, without using a html file ?
I have a jar file which contains a set of class files. iam able to execute the jar file by using this html code
<html>
<applet code="file.class" archive="file.jar" width="500" height="300">
<param name="name" value="value">
</applet>
</html>
I want to know how to execute this class file without using the html tags.
pls help me out in this.
AnkiHi,
You can make an executable jar file such that when you double click on that it starts running. Just follow the steps.
1. Open a notepad and write the following
Main-Class: XXXXXXXX
XXXXXXX means Your Main Class name. Don't forget to press Enter after you write your class name.
2. Save the file as Mani.mf
3. In the commant prompt ( your directory ) type following lines.
jar cmf Mani.mf Demo.jar *.*
4. This will make a jar file which is executable jar file
Hope this will help you.
Deepak -
How to execute a jar file in other machine?
Hi all,
I am working with java. and my machine is connected to LAN.I would like to execute a jar file in my machine from a remote machine that is also connected to LAN.how should i go about doing this.Help me if somebody have a solution as i am badly in need of this.
Regards,
MohanHi Mohan.tkm,
If you want it to be done in pure Java and independently of the OS of both computers, you may build a RMI server that will launch your JAR by request of a remote RMI client.
There's an example of RMI here . -
Hi All,
I have a problem executing a function in oracle 10g.
I am getting an error while executing ....
Here is a function along with the error i am getting:
create or replace FUNCTION UnpackArray
Source IN VARCHAR2 DEFAULT NULL,
Delimiter IN CHAR DEFAULT ','
RETURN reSourceArray0 PIPELINED
IS
SourceArray00 SourceArray0:=SourceArray0(NULL);
TYPE REFCURSOR IS REF CURSOR;
CURSOR0 REFCURSOR;
DelLen int;
Pos int;
Cnt int;
str int;
LEN int;
Holder VARCHAR2(220);
BEGIN
--Check for NULL
IF Source is null or Delimiter is null THEN
Return;
END IF;
--Check for at leat one entry
IF RTRIM(LTRIM(Source)) = '' THEN
Return;
END IF;
/*Get the length of the delimeter*/
SELECT LENGTH(RTRIM(Delimiter)) INTO DelLen FROM DUAL;
SELECT INSTR(UPPER(Source), UPPER(Delimiter)) INTO Pos FROM DUAL;
--Only one entry was found
IF Pos = 0 THEN
BEGIN
INSERT INTO UnpackArray_TBL
( Data )
VALUES ( Source );
return;
OPEN CURSOR0 FOR SELECT * FROM UnpackArray_TBL;
END;
END IF;
/*More than one entry was found - loop to get all of them*/
SELECT 1 INTO str FROM DUAL;
<< LABEL4 >>
WHILE Pos > 0
LOOP
BEGIN
/*Set current entry*/
SELECT Pos - str INTO len FROM DUAL;
SELECT SUBSTR(Source, str, len) INTO Holder FROM DUAL;
/* Update array and counter*/
/* Update array and counter*/
INSERT INTO UnpackArray_TBL
VALUES ( Holder );
/*Set the new strting position*/
SELECT Pos + DelLen INTO str FROM DUAL;
SELECT INSTR(UPPER(Source), UPPER(Delimiter), str) INTO Pos FROM DUAL;
OPEN CURSOR0 FOR SELECT * FROM UnpackArray_TBL;
END;
END LOOP;
/*Set last entry*/
SELECT SUBSTR(Source, str, length(RTRIM(Source))) INTO Holder FROM DUAL;
-- Update array and counter if necessary
IF length(RTRIM(Holder)) > 0 THEN
INSERT INTO UnpackArray_TBL
VALUES ( Holder );
OPEN CURSOR0 FOR SELECT * FROM UnpackArray_TBL;
END IF;
--Return the number of entries found
Return; LOOP
FETCH CURSOR0 INTO
SourceArray00.Data;
EXIT WHEN CURSOR0%NOTFOUND;
PIPE ROW(SourceArray00);
END LOOP;
CLOSE CURSOR0;
RETURN;
END;
Error is : Compilation failed,line 6 (12:13:25)
PLS-00201: identifier 'RESOURCEARRAY0' must be declared
Compilation failed,line 0 (12:13:25)
PL/SQL: Compilation unit analysis terminated
Regards,
SmileyHi,
I have a problem executing this function. Pls help me solve this issue.
---------------------------------Function---------------------------------
BEGIN
EXECUTE IMMEDIATE 'DROP TYPE reSourceArray0';
EXECUTE IMMEDIATE 'DROP TYPE SourceArray0';
EXCEPTION WHEN OTHERS THEN NULL;
END;
CREATE OR REPLACE TYPE SourceArray0 AS OBJECT(Data VARCHAR2(255));
CREATE OR REPLACE TYPE reSourceArray0 AS TABLE OF SourceArray0;
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE UnpackArray_TBL CASCADE CONSTRAINTS';
EXCEPTION WHEN OTHERS THEN NULL;
END;
CREATE GLOBAL TEMPORARY TABLE UnpackArray_TBL(Data VARCHAR2(255)) ON COMMIT PRESERVE ROWS
CREATE OR REPLACE FUNCTION UnpackArray
Source IN VARCHAR2 DEFAULT NULL,
Delimiter IN CHAR DEFAULT ','
RETURN reSourceArray0 PIPELINED
IS
SourceArray00 SourceArray0:=SourceArray0(NULL);
TYPE REFCURSOR IS REF CURSOR;
CURSOR0 REFCURSOR;
DelLen int;
Pos int;
COUNT_ADV int;
START_ADV int;
LENGTH_ADV int;
Holder VARCHAR2(255);
BEGIN
--Check for NULL
IF Source is null or Delimiter is null THEN
Return;
END IF;
--Check for at leat one entry
IF RTRIM(LTRIM(Source)) = '' THEN
Return;
END IF;
/*Get the length of the delimeter*/
SELECT LENGTH(RTRIM(Delimiter)) INTO DelLen FROM DUAL;
SELECT INSTR(UPPER(Source), UPPER(Delimiter)) INTO Pos FROM DUAL;
--Only one entry was found
IF Pos = 0 THEN
BEGIN
INSERT INTO UnpackArray_TBL
( Data )
VALUES ( Source );
return;
OPEN CURSOR0 FOR SELECT * FROM UnpackArray_TBL;
END;
END IF;
/*More than one entry was found - loop to get all of them*/
SELECT 1 INTO START_ADV FROM DUAL;
<< LABEL4 >>
WHILE Pos > 0
LOOP
BEGIN
/*Set current entry*/
SELECT Pos - START_ADV INTO LENGTH_ADV FROM DUAL;
SELECT SUBSTR(Source, start_, length) INTO Holder FROM DUAL;
/* Update array and counter*/
/* Update array and counter*/
INSERT INTO UnpackArray_TBL
VALUES ( Holder );
/*Set the new starting position*/
SELECT Pos + DelLen INTO START_ADV FROM DUAL;
SELECT INSTR(UPPER(Source), UPPER(Delimiter), START_ADV) INTO Pos FROM DUAL;
OPEN CURSOR0 FOR SELECT * FROM UnpackArray_TBL;
END;
END LOOP;
/*Set last entry*/
SELECT SUBSTR(Source, start_, LENGTH(RTRIM(Source))) INTO Holder FROM DUAL;
-- Update array and counter if necessary
IF LENGTH(RTRIM(Holder)) > 0 THEN
INSERT INTO UnpackArray_TBL
VALUES ( Holder );
OPEN CURSOR0 FOR SELECT * FROM UnpackArray_TBL;
END IF;
--Return the number of entries found
Return; LOOP
FETCH CURSOR0 INTO
SourceArray00.Data;
EXIT WHEN CURSOR0%NOTFOUND;
PIPE ROW(SourceArray00);
END LOOP;
CLOSE CURSOR0;
RETURN;
END;
--------------------------------Error i am getting--------------------------
"Parameter 'RETURN_VALUE': No size set for variable length data type: String."
Thanks and Regards,
Smiley -
Problem executing a sql query in 10g environment
Hi,
I am having problem executing the following sql query in 10g environment. It works fine in 8i environment.
I tried to_number(to_char) and it did not work.
**A.APPL_ACTION_DT >= TO_CHAR("&v_strBeginStatusDate&", 'DD-MON-YYYY') AND A.APPL_ACTION_DT <= TO_CHAR("&v_strEndStatusDate&", 'DD-MON-YYYY')))**
Any suggestions..
--PavanI would be surprised if that worked in 8i as posted, although I no longer have 8i to test. You do not tell us the error message you are getting, but there are several things wrong with what you posted.
First, the substitution variable requires only the & at the beginning, you have one on each end of your string, the one at the end will remain in the string that is passed to the database.
Second, you cannot TO_CHAR a string with a date format as you are trying to do. The TO_CHAR function is overloaded and has two basic forms TO_CHAR(date, format_model) and TO_CHAR(number, format_model). Note that neither takes a string. It would appear that at least current versions of Oracle choose the second signature unless specifically passed a date datatype.
SQL> select to_char('&h', 'dd-mon-yyyy') from dual;
Enter value for h: 12
old 1: select to_char('&h', 'dd-mon-yyyy') from dual
new 1: select to_char('12', 'dd-mon-yyyy') from dual
select to_char('12', 'dd-mon-yyyy') from dual
ERROR at line 1:
ORA-01481: invalid number format modelalthough I suspect that the error you are getting with your posted code is more likely to be ORA-01722: invalid number.
Depending on the data type of appl_action_date, you are probably lokoing for TO_DATE instead of TO_CHAR.
John -
Oracle 11gR2 to SQL Server 2008 R2 - Problem executing SP on SQL server
Hi,
I have this problem: Executing a sp in SQL server from oracle
--------------------ORACLE SP--------------------
create or replace
PROCEDURE DRIVER_SP
AP IN OUT appl_param%ROWTYPE
as
v_sp_name varchar2(50);
v_control_id number;
val VARCHAR2(100);
cur INTEGER;
nr INTEGER;
BEGIN
v_sp_name := ap.MESSAGE_MISC_TEXT;
v_control_id := ap.control_id;
cur := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@dblink_sqlserver;
DBMS_HS_PASSTHROUGH.PARSE@dblink_sqlserver(cur, 'execute ' || v_sp_name || ' ' || to_char(v_control_id));
LOOP
nr := DBMS_HS_PASSTHROUGH.FETCH_ROW@dblink_sqlserver(cur);
EXIT WHEN nr = 0;
DBMS_HS_PASSTHROUGH.GET_VALUE@dblink_sqlserver(cur, 1, val);
END LOOP;
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@dblink_sqlserver(cur);
driver_ap01_log_msg('Procedure returned: ' || val);
commit;
exception
when others then
driver_ap01_log_msg(sqlerrm);
END DRIVER_SP;
--------------------SQL Server SP-----------------------
ALTER PROCEDURE [dbo].[PA01_SP]
@control_id integer
AS
begin
--update PA01
--set infile_control_id = @control_id
--insert into dbo.PA01LOG(msg) values('test')
select 0
end
THE PROBLEM: Oracle SP calls SQL Server SP and any time I try to INSERT/UPDATE/DELETE (DML) within SQLServer SP it throws an exception on Oracle's end. Once I comment all DML code the proc runs fine.
+"ORA-28511: lost RPC connection to heterogeneous remote agent using SID=ORA-28511: lost RPC connection to heterogeneous remote agent using SID=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxxx)(PORT=1511))(CONNECT_DATA=(SID=dg4msql)))+
+ORA-02063: preceding line from DBLINK_SQLSERVER"+
Please help.
ThanksThanks for your response, it got me closer to my goal. I'm still facing one problem:
Let me explain what I need to achieve
Purpose
Execute an Oracle stored procedure which in turn executes a stored procedure on remote SQLServer which updates local tables on that SQLServer.
Observations
The execution of both procedures completes successfully. However, an explicit COMMIT statement must be issued on the Oracle session which initiated the transaction before any data could be read from the SQLServer updated table.
The following is test exercise for proof of concept.
PL/SQL code
declare
out_arg integer;
ret_val integer;
begin
out_arg := 0;
ret_val := "dbo"."ZZZ_SP"@DBLINK_SQLSERVER(10, out_arg);
dbms_output.put_line(to_char(out_arg));
end;
SQLServer code
ALTER procedure [dbo].[ZZZ_SP] (@arg1 integer, @arg2 integer output)
AS
begin tran tran1
insert into dbo.PA01LOG(msg) values('ddd')
commit tran tran1
set @arg2 = @arg1 * 100
select -1
GO
I have put the Oracle gateway in Single_Site mode to avoid two phase commit. I want SQLServer to be able to run its own transaction management. I don't want Oracle to be responsible for completing the transactions which take place within SQLServer.
I fear there might be a gap in my knowledge.
Any ideas why I need to issue a COMMIT in Oracle session to release the lock from SQLServer table?
Thanks
Maybe you are looking for
-
Loading XSL file in XSL Transforam action at run time
Hello everyone , I want to use XSL Transforamtion action in weblogic integration and name of XSL file should pick at run time from a variable. I am using :"com.bea.wlxt.repository" package APIs for connecting to repository & get the XSL file from it.
-
Am I correct that I need to NAT a public address to the private address of my Windows server in order to have a fully functional Exchange server in-house? My ISP tells me I can give them the required information and they will switch from them providi
-
I have a blackberry curve, 8300. Look I am an old lady here, so any help would be appreciated. I have had this phone for over a year....I used to be able to download apps and I have downloaded weather, etc. Now all of a sudden it is saying my email
-
What is circuit t1/e1 ? help me plz
I read in one of Job descritpion "Experience of working on circuit(T1/E1,T3/E3,Ethernet) troubleshooting would be preferred". Could u please help me this "circuit t1/e1,etc". Is it covered in ccna or ccnp rs ? Is it frame-relay or mpls or other? Co
-
Hello, all, Why can't I get content from my new Canon VIXIA HF10 as an AVCHD device on PE7? I'm able to manually navigate to the files when I "Get Media" from "PC Files and Folders". But I'm curious why its not recognized as an AVCHD device and if so