Calling store procedure using class cl_sql_statement not running
Hello together
i want to call a stored procedure that has an input and an output parameter but when i using my coding i m getting the following error
ORA-06550: line 1, column 7:#PLS-00201: identifier 'STORED_PROC_NAME' must be declared#ORA-06550: line 1, column 7:#PL/SQL: Statement ignored
GET REFERENCE OF lv_input IN lr_dref."in
lr_cl_sql_statement->set_param( data_ref = lr_dref
inout = cl_sql_statement=>C_PARAM_IN ).
GET REFERENCE OF lv_out INTO lr_dref. "out
lr_cl_sql_statement->set_param( data_ref = lr_dref
inout = cl_sql_statement=>C_PARAM_OUT ).
TRY.
data lv_ROWS_PROCESSED type i.
CALL METHOD LR_CL_SQL_STATEMENT->EXECUTE_PROCEDURE
EXPORTING
PROC_NAME ='Stored_Proc_Name'
RECEIVING
ROWS_PROCESSED = lv_ROWS_PROCESSED
i my oppinion there could be an error in setting the parameters. Has anyone an running solution for calling a stored procedure with in and out parameter. I already tested the ADBC Programs and even had a sight in the class documentation but there is no example with in and output parameter.
Thank your for your help!
Hi
Not sure as the exact solution , but you can try the following :
You are executing the "stored procedure" as which user , is it under your schema and do you have execute priveleges on it.
Please see below links , might be helpful to you :
http://forums.devshed.com/java-help-9/call-stored-procedure-337312.html
http://bytes.com/topic/oracle/answers/643380-pls-00201-identifier-user-procedure-name-must-declared
Thanks
Rishi
Similar Messages
-
Problem of retrieve a set of data when calling store procedure using vb with ODBC
when I use ODBC, it can return 1 record (1 field) using pass and retrieve the parameter. but it cannot success when return a set of data (using recordset to store it), when i do it, the error message (Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if availabl. No work was done.). Why ? and how can solve it ?\
Thanks in advance.oh, really ? it is not use ODBC to connecto to oracle ?
Here is my program code:
STORE PROCEDURE:
PROCEDURE getInforcePolicy(PClient_ID IN VARCHAR2, PPolicy_No IN VARCHAR2, BasicCur OUT oraoledb.m_refcur, RiderCur OUT oraoledb.m_refcur)
IS
BEGIN
OPEN BasicCur FOR SELECT * FROM
inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No = 1;
OPEN RiderCur FOR SELECT * FROM
inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No <> 1;
END getInforcePolicy;
PACKAGE oraoledb AS
TYPE m_refcur IS REF CURSOR;
END oraoledb;
Program:
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim cmd As New ADODB.Command
Dim paramclient As New ADODB.Parameter
Dim parampolicy As New ADODB.Parameter
Dim I As Integer
cn.Open "ridev", "abc","abc"
cmd.ActiveConnection = cn
Set paramclient = cmd.CreateParameter("PClient", adVarChar, adParamInput, 10)
Set parampolicy = cmd.CreateParameter("PPolicy", adVarChar, adParamInput, 10)
paramclient.Value = "0000023011"
parampolicy.Value = "HK0010021U"
cmd.Parameters.Append paramclient
cmd.Parameters.Append parampolicy
cmd.CommandText = "{call getInforcePolicy}"
Set rs = cmd.Execute
Do While Not rs.EOF
Loop
Set rs2 = rs.NextRecordset
Do While Not rs2.EOF
loop
Where the RIDEV is a datasource that created from Data Source in Control Panel using the driver call "Microsoft ODBC for ORACLE" -
ADF 11, USING EJB, CALL STORE PROCEDURE, A PROBLEAM?
ADF 11, USING EJB, CALL STORE PROCEDURE, A PROBLEAM?
I have a store procedure:
CREATE OR REPLACE PACKAGE BODY PK_HR1
IS
FUNCTION FUNC04
RETURN CUR_RESULT
IS
X_CUR CUR_RESULT;
BEGIN
OPEN X_CUR FOR
select mako, tenko, diachiko from kho;
RETURN X_CUR;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END FUNC04;
END PK_HR1;
In the entities class, I have a NamedStoredProcedureQuery:
@Entity
@NamedStoredProcedureQuery(name="Kho.FUNC04",
resultClass=Kho.class,
procedureName="PK_HR1.FUNC04" )
public class Kho implements Serializable {
In session bean, i have a method
public class SessionEJBBean implements SessionEJB, SessionEJBLocal
public void test() throws Exception{
try {
//code here ...
List<Kho> listKho = em.createNamedQuery("Kho.FUNC04").getResultList();
System.out.println("aaaa");
} catch (Exception ex) {
ex.printStackTrace();
} finally {
I try running, but always show errror
this errors:
Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00221: 'FUNC04' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error Code: 6550
Call: BEGIN PK_HR1.FUNC04(); END;
Query: ReadAllQuery(jp.co.mfr.sgs.bean.Kho)
help help me?You need to use a CallableStatement for this.
--olaf -
Weird Problem calling Stored Procedure using JDBC
Scenario is..
I have J2EE application and calling stored procedure using JDBC.
My application connects to instance "A" of testDB.
Schema "A" does NOT own any packages/procedure but granted execute on oracle packages/procedures that reside in schema "B" of testDB.
In java code I call procedure(proc1) in package(pac1) which internally calls procedure(proc2) in package(pac2).
The problem occurs when procedure pac2.proc2 is modified. After the modification, my java code fails and throws an exception "User-Defined Exception" and I am also getting "ORA-06508: PL/SQL: could not find program unit being called". This clears up only if I bounce the web container. (This doesn't happen if I modify pac1.proc1 and run my application)
Has any one faced this problem? Please suggest if any thing can be changed in jdbc code to fix this problem.
ThanksHi,
I assume these are PL/SQL packages and that the changes are made at the package specification level?
If so, it looks like you are hitting the PL/SQL dependencies rules. In other words, if the spec of proc2 is changed, then proc1 is invalidated, since proc1 still depends on the old version of proc2's spec. As a result, if you try to run proc1, its spec must either be explicitly rewritten before it could run again or implicitly recompiled first, if the (implicit) recompilation fails, it won’t run.
Kuassi http://db360.blogspot.com -
Calling Stored Procedure using J2EE (CMP/BMP)
Hi guys,
Can anyone please help me of how to call a stored procedure using a bean in J2EE? I am using Sybase as a database. I am not sure of how to call a stored procedure that is stored in the database server.
I have one more problem that I am getting in my application. I have 6 entity beans for 6 tables (3 temporary which are deleted and created as and when deployed and 3 permanent which are not deleted when deployed). When I access and manipulate data in temporary tables, everything works fine. But when I try to insert records in the 3 permanent tables, i get an error saying...
ejbexception.transactionrolledbackerror - Client's transaction rolledback
Your suggestions would be very valuable.
Thanks in advance,
ashishActually, I was getting the RolledBack exception before I was using stored procedure. The bean was supposed to make a few transactions in the tables within the Sybase database. Since it gave me rolledback error, I decided to write a stored proc. in the database and to call that procedure using the bean.
Now, I am not sure of how to call that procedure using the bean. Also, the syntax of calling that procedure using CallableStatement. I believe, I would have to use Bean Managed Persistence (BMP) if I want to use CallableStatement. I am fooling around with it right now and would let you know if I am getting any exceptions or errors. Meanwhile, any help on the syntax of calling the stored proc. would be highly appreciated.
Thanks in advance
Ashish -
Calling a procedure using JDBC-OCI
When I use setPlsqlIndexTable for calling a procedure using JDBC-OCI
ps.setPlsqlIndexTable(1,str,10,str.length,OracleTypes.VARCHAR,8);
always throw a Exception :
java.sql.SQLException: Non supported character set: oracle-character-set-832
at oracle.gss.util.NLSError.throwSQLException(NLSError.java:46)
at oracle.sql.CharacterSetUnknown.failCharsetUnknown(CharacterSetFactoryThin.java:171)
at oracle.sql.CharacterSetUnknown.convert(CharacterSetFactoryThin.java:135)
at oracle.sql.CHAR.<init>(CHAR.java:133)
at oracle.sql.CHAR.<init>(CHAR.java:157)
at oracle.jdbc.oracore.OracleTypeCHAR.toDatum(OracleTypeCHAR.java:145)
at oracle.jdbc.oracore.OracleType.toDatumArray(OracleType.java:145)
at oracle.jdbc.oracore.OracleTypeCHAR.toDatumArray(OracleTypeCHAR.java:173)
at oracle.jdbc.driver.OraclePreparedStatement.setPlsqlIndexTable(OraclePreparedStatement.java:2622)
When can tell me how to solve it? ThanksI hava resolve this problem, we must add the
class nls_charset12.zip to classpath. -
About JDBC CALL STORE PROCEDURE with out parameter is greater than 4000
Hi Guys,
I have a problem call store procedure with a large string.
as i know varchar2 can contain 32767 characters in pl/sql .
But when i used varchar2 as a out parameter in a store procedure, if the out parameter is greater than 4000 characters , it always give me error message as 'the buffer is too small'.
why it happened?
I read some article that says i need configure a property in data-source.xml , and jdbc 10g driver already solved this problem, but i used jdev 10.1.3.2 ,the driver should be fine.
How can i solve this problem?
Thanks in advance,
AppCatObject is Foundation, Execute Script
This is for a query, you can change to a stored procedure call. Pull the value back in the Java code then put into the process variable.
import javax.naming.InitialContext;
import javax.sql.DataSource;
import java.sql.*;
PreparedStatement stmt = null;
Connection conn = null;
ResultSet rs = null;
try {
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:IDP_DS");
conn = ds.getConnection();
stmt = conn.prepareStatement("select FUBAR from TB_PT_FUBAR where PROCESS_INSTANCE_ID=?");
stmt.setLong(1, patExecContext.getProcessDataLongValue("/process_data/@inputID"));
rs = stmt.executeQuery();
rs.next();
patExecContext.setProcessDataStringValue("/process_data/outData", rs.getString(1));
} finally {
try {
rs.close();
} catch (Exception rse) {}
try {
stmt.close();
} catch (Exception sse) {}
try {
conn.close();
} catch (Exception cse) {} -
How to call store procedure in query generator
Hi All,
How to call store procedure in query generator.
Regards
Rajkumar Gupta
Edited by: Rajkumar Gupta on Dec 7, 2010 2:11 AMHi,
Please check the following threads.
How to use Stored Procedure in sap business one
How to add parameters to a stored procedure in B1 Query generator
How to execute the procedure in sap b1
Hope it helps,
Vasu Natari. -
I want to know the top 10-20 Store procedures used in the table.
Hello All,
There are total 3500+ Store procedures created in the server. So, I want to know the top 10-20 Store procedures used in the table. Like which store procedures are important and what are they, is there any code to find them?
I think the question might be very silly, but i don't know which store procedure to look at it.
Please help me on this issue.
Thanks.
Thanks, Shyam.By what? CPU? Memory? Execution count?
Glenn Berry wrote this
-- HIGH CPU ************
-- Get Top 100 executed SP's ordered by execution count
SELECT TOP 100 qt.text AS 'SP Name', qs.execution_count AS 'Execution Count',
qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()) AS 'Calls/Second',
qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
qs.total_worker_time AS 'TotalWorkerTime',
qs.total_elapsed_time/qs.execution_count AS 'AvgElapsedTime',
qs.max_logical_reads, qs.max_logical_writes, qs.total_physical_reads,
DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
WHERE qt.dbid = db_id() -- Filter by current database
ORDER BY qs.execution_count DESC
-- HIGH CPU *************
-- Get Top 20 executed SP's ordered by total worker time (CPU pressure)
SELECT TOP 20 qt.text AS 'SP Name', qs.total_worker_time AS 'TotalWorkerTime',
qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
qs.execution_count AS 'Execution Count',
ISNULL(qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()), 0) AS 'Calls/Second',
ISNULL(qs.total_elapsed_time/qs.execution_count, 0) AS 'AvgElapsedTime',
qs.max_logical_reads, qs.max_logical_writes,
DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
WHERE qt.dbid = db_id() -- Filter by current database
ORDER BY qs.total_worker_time DESC
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
PP Procedure is Missing, Can not Run the Preprocessor
hi experts,
while executing some module program through TCODE. I got this error PP Procedure is Missing, Can not Run the Preprocessor
can any one help me ?
thanks,
nag.Hello,
What I thought you meant when you said "Port" was that you were using a Distribution project to move it to other machines. Therefore you have two options to proceed.
1) Copy the nicppaiu.dll from the system folder on your machine to the system folder on another machine you are "Porting" to.
2) Add a project to your solution that is a Setup project. Then add the output of your application to this project and add the MSM discussed earlier. This will create a MSI that can be used to install your application on multiple machines (it still requires a NI-DAQmx install).
There is a good topic in our help named "Deploying Measurement Studio Applications" that tells you everything you need to know.
Regards,
Jeff -
I log in in the Enterprise manager with the user "Nadia" that I created . I Created an escheme TEST and all the tables .
I Created also the package with this user. It has a procedure that returns 1 cursor.
This user has:
atributte: CONNECT, DBA AND RESOUCE
System: EXECUTE ANY PROCEDURE AND UNLIMITED TABLESPACE
Is it correct?
My application is access the oracle 9i with this user too.
I have to call the procedure this way:
SID.PACKAGE.PROCEDURE
Im my vb code, I am call this way too.
Code VB 6:
With cmd
.ActiveConnection = CNP
.CommandText = "NADIA.EXT_DADOS.DADOS_VISITANTE" ????
.Prepared = False
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@Documento", adInteger, adParamInput, 15, 8384474)
.Parameters.Append .CreateParameter("@nome", adChar, adParamInput, 1, lsTipo)
Set ObReg = .Execute(, , adAsyncFetchNonBlocking)
End With
When execute, message errors show:
The NADIA.EXT_DADOS.DADOS_VISITANTE needs to be declared.
Wha is wrong?
thank you
NádiaIt looks like you are getting appropriate feedback in one of the other threads on this topic that you've posted:
To call Store procedure
But I would have to say that I hope this is just a test system. I would never grant DBA, EXECUTE ANY PROCEDURE, and UNLIMITED TABLESPACE to a "normal" user in a production system.
Good luck,
Mark -
About call the store procedure using VB with ODBC
I want to ask how can I use the vb with ODBC call the oracle's store procedure ? I try to pass the parameter from vb and return 1 result, it is ok, but when I try to pass 1 parameter with return mutiple result (put it in recordset), the error message occured(Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available, No work was done) why ?? I can success whit using OLE DB, but why not in ODBC ?? does anybody can help me ?? Thanks a lot.
oh, really ? it is not use ODBC to connecto to oracle ?
Here is my program code:
STORE PROCEDURE:
PROCEDURE getInforcePolicy(PClient_ID IN VARCHAR2, PPolicy_No IN VARCHAR2, BasicCur OUT oraoledb.m_refcur, RiderCur OUT oraoledb.m_refcur)
IS
BEGIN
OPEN BasicCur FOR SELECT * FROM
inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No = 1;
OPEN RiderCur FOR SELECT * FROM
inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No <> 1;
END getInforcePolicy;
PACKAGE oraoledb AS
TYPE m_refcur IS REF CURSOR;
END oraoledb;
Program:
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim cmd As New ADODB.Command
Dim paramclient As New ADODB.Parameter
Dim parampolicy As New ADODB.Parameter
Dim I As Integer
cn.Open "ridev", "abc","abc"
cmd.ActiveConnection = cn
Set paramclient = cmd.CreateParameter("PClient", adVarChar, adParamInput, 10)
Set parampolicy = cmd.CreateParameter("PPolicy", adVarChar, adParamInput, 10)
paramclient.Value = "0000023011"
parampolicy.Value = "HK0010021U"
cmd.Parameters.Append paramclient
cmd.Parameters.Append parampolicy
cmd.CommandText = "{call getInforcePolicy}"
Set rs = cmd.Execute
Do While Not rs.EOF
Loop
Set rs2 = rs.NextRecordset
Do While Not rs2.EOF
loop
Where the RIDEV is a datasource that created from Data Source in Control Panel using the driver call "Microsoft ODBC for ORACLE" -
Problem Using Java Store Procedure (java class) to connect to sybase
Hi, I'm trying to use a java class to obtain some data from another databse (SYBASE) in another server.. here are the code
package pkg;
import com.sybase.jdbcx.SybDriver;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class clsTest
public clsTest()
public static void main(String[] args)
testConn("");
private static void testConn()
Connection _con= null;
String host = "XXX";
String port= "XXX";
String url = host + ":" + port;
Statement _stmt= null;
int timeout = 10;
boolean needsReconnect = true;
SybDriver sybDriver = null;
try
Class c = Class.forName("com.sybase.jdbc3.jdbc.SybDriver");
sybDriver = (SybDriver) c.newInstance();
DriverManager.registerDriver((Driver) sybDriver);
catch (Exception e)
System.err.print("Unable to load the Sybase JDBC driver. "
+ e.toString());
e.printStackTrace(System.out);
if (needsReconnect)
try
if (_con != null)
_con.close();
url="jdbc:sybase:Tds:BDSERVER:PORT/BD";
System.err.println("Trying to connect to: " + url);
DriverManager.setLoginTimeout(timeout);
con = DriverManager.getConnection(url,"usrquery","mundial");
_stmt = _con.createStatement();
boolean results = _stmt.execute("select count(*) from TABLA");
if (results)
ResultSet rs= _stmt.getResultSet();
rs.next();
System.err.println(rs.getString(1));
_con.close();
catch (SQLException sqle)
System.err.println(sqle.toString() + " Restart connection.");
return;
catch (Exception e)
e.printStackTrace();
System.err.println("Unexpected Exception: " + e.toString());
return;
When I run the proyect using the IDE JDeveloper I have no problem, but when I make de use loadjava I receive these error message
creating : resource META-INF/MANIFEST.MF
loading : resource META-INF/MANIFEST.MF
Error while creating resource META-INF/MANIFEST.MF
ORA-29547: Java system class not available: oracle/aurora/rdbms/Compiler
creating : class pkg/clsTest
loading : class pkg/clsTest
creating : resource jconn3.jar
loading : resource jconn3.jar
Error while creating resource jconn3.jar
ORA-29547: Java system class not available: oracle/aurora/rdbms/Compiler
granting : execute on class pkg/clsTest to public
Error while computing shortname of pkg/clsSybaseLAE
ORA-06550: line 1, column 13:
PLS-00201: identifier 'DBMS_JAVA.SHORTNAME' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
resolving: class pkg/clsTest
errors : class pkg/clsTest
ORA-29521: referenced name java/lang/StringBuffer could not be found
ORA-29521: referenced name java/lang/Class could not be found
ORA-29521: referenced name com/sybase/jdbcx/SybDriver could not be found
ORA-29521: referenced name java/sql/Driver could not be found
ORA-29521: referenced name java/sql/DriverManager could not be found
ORA-29521: referenced name java/lang/System could not be found
ORA-29521: referenced name java/lang/Exception could not be found
ORA-29521: referenced name java/io/PrintStream could not be found
ORA-29521: referenced name java/sql/Connection could not be found
ORA-29521: referenced name java/sql/Statement could not be found
ORA-29521: referenced name java/sql/ResultSet could not be found
ORA-29521: referenced name java/sql/SQLException could not be found
ORA-29521: referenced name java/lang/Object could not be found
ORA-29521: referenced name java/lang/String could not be found
synonym : pkg/clsTest
The following operations failed
resource META-INF/MANIFEST.MF: creation
class pkg/clsTest: resolution
resource jconn3.jar: creation
exiting : Failures occurred during processing
Please some one help me!.. Thank's a lotThanks, you was right, but I have another problem
The following operations failed
class cl/bcch/clsSyBase: resolution
source cl/bcch/clsSyBase: creation (createFailed)
oracle.aurora.server.tools.loadjava.ToolsException: Failures occurred during processing
at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:1057)
at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:124)
at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:53)
at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:98)
at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:503)
at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:381)
at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:300)
at oracle.jdevimpl.deploy.StoredProcProfileDt$Action$1.run(StoredProcProfileDt.java:598)
#### Export incomplete. #### 09-01-2008 02:28:39 PM
*** Note ***
One possibility for the database export failure is that the target Database may not support JDK version 1.4. Updating your Project Properties compiler Source & Target to an earlier release could fix this problem.
************ -
How to load and define Java Store Procedures using Consolidator Manager??
Hi,
I am trying to create a store procedure with a very easy example and I can not succeed. i am a bit new with OLite and I will appreciate any help from your side. I am quite lost now regarding of using java with OLite and it is becoming quite urgent for me. Thanks a lot in advanced.
Those are the steps that I follow:
- Creating the java class
I create the java file MYUPPER.java with next code :
public class MYUPPER {
public static String doUpper( String p_text )
return p_text.toUpperCase();
I compile it and I create the jar file:
C:\>javac MYUPPER.java
C:\>jar cf MYUPPER.jar MYUPPER.class
- This is an abstract of my java code using the API:
( m_cm is ConsolidatorManager)
// Create the java resource
m_cm.createStoredProc( "MYUPPER.jar", "MYUPPER", "doUpper", "doUpper");
// Add it to the publication
m_cm.addJavaResource( "PMTS", "MYUPPER" );
- After running that code I do not receive any exception and checking into the repository looks ok:
a) From the Mobile Server I can see the Java Ressource MYUPPER for that publication
b) I can see the entries in C$Resouces and in C$Pub_Objects as well
*** ON THE CLIENT:
Then I go to the client device a Windows XP labtop where I did install the jre 5.0 and I added the bin path to the system variable PATH.
- I get a POL-8000 error when synchronizing (could not start the Java Visrtual Machine)
- Anyway, I can see the MYUPPER.class file deployed in the same directory than the databases are.
- I have also tried next from msql:
c:\>msql system/manager@jdbc:polite:tomeu_conscli
Oracle Lite MSQL Version 10.3.0.2.0
Copyright (c) 1997, 2008, Oracle. All rights reserved.
Connected to: Oracle Lite ORDBMS
Database Name: CONSCLI (Read Write)
Database Version: 10.3.0.2.0
Auto Commit: off
Driver Name: oracle.lite.poljdbc.POLJDBCDriver (OLite 4.0)
SQL> select * from c$resources;
PUB_NAME | DB_NAME | RESOURCE_NAME | RESOURCE_TYPE | RESOURCE_DATA
PMTS | pmts | MYUPPER | JAVA CLASS | -¦¦¥ 1
1 row(s) returned
SQL>
SQL> exit
Disconnected from CONSCLI
c:\>msql system/*****@jdbc:polite:tomeu_pmts
Oracle Lite MSQL Version 10.3.0.2.0
Copyright (c) 1997, 2008, Oracle. All rights reserved.
Connected to: Oracle Lite ORDBMS
Database Name: PMTS (Read Write)
Database Version: 10.3.0.2.0
Auto Commit: off
Driver Name: oracle.lite.poljdbc.POLJDBCDriver (OLite 4.0)
SQL> select doUpper('fhjdjf') from dual;
[POL-8035] no such attribute or method
SQL> create table sp (id number(1) primary key );
Table created
SQL> alter table sp attach java source "MYUPPER" in '.';
[POL-8028] error in calling a Java method
SQL> commit;
Commit complete
SQL> select sp.doUpper('fhjdjf') from dual;
[POL-8035] no such attribute or method
Lost... :(
Tomeusorry to bother, similar like above, i tried many times on my computer to load a simple image in java application.. here's my code:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.net.*;
import javax.swing.*;
public class View extends JFrame {
private URL imageURL;
private File file;
private Image sourceImage;
private String name, title, message;
private int width, height;
public static void main(String[] args) {
System.out.println( "Hello Eros!!!" );
View img = new View();
public View() {
name = "D:/shared/inputpic.gif";
file = new File( name );
Toolkit toolkit = Toolkit.getDefaultToolkit();
try {
imageURL = new URL("http://www.google.com.my/images/logo_sm.gif" );
} catch (MalformedURLException e) {
if ( file == null ) {
sourceImage = Toolkit.getDefaultToolkit().getImage( name );
System.out.println( file );
} else {
sourceImage = toolkit.getImage( imageURL );
System.out.println( file );
width = sourceImage.getWidth( this );
height = sourceImage.getHeight( this );
System.out.println( "Pixel = " + width + "x" + height );
if ( width * height == 1 ) {
title = "Greetings"; // Shown in title bar of dialog box.
if ( file == null ) {
message = "Unable to load the file " + name;
} else {
message = "Unable to load the link " + imageURL;
JOptionPane.showMessageDialog(null, message, title, JOptionPane.INFORMATION_MESSAGE);
}could anyone test this n give my the reason i couldnt even load the image -
Creating and calling stored procedure using jdbc
When I try to create and call a stored procedure using JDBC a very confusing error message about non-existence of the procedure just created is thrown. Using Informix database (IDS 10). Any pointers to point out what am doing wrong would be great!
Thanks
import java.io.FileNotFoundException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
public class CreateStoredProc {
public static void main(String args[]){
if (0 == args.length)
return;
try {
Class.forName("com.informix.jdbc.IfxDriver");
Connection conn = DriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");
String q = " create procedure runproc() "+
" define i int; "+
" let i = 0; "+
" end procedure; "+
" execute procedure runproc(); ";
Statement stmt = conn.createStatement ();
stmt.execute (q);
} catch (Exception e) {
e.printStackTrace();
The stack trace:
java.sql.SQLException: Routine (runproc) can not be resolved.
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3204)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2157)
at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2132)
at com.informix.jdbc.IfxResultSet.b(IfxResultSet.java:378)
at com.informix.jdbc.IfxStatement.a(IfxStatement.java:1299)
at com.informix.jdbc.IfxStatement.executeImpl(IfxStatement.java:1269)
at com.informix.jdbc.IfxStatement.c(IfxStatement.java:989)
at com.informix.jdbc.IfxStatement.execute(IfxStatement.java:875)
at CreateStoredProc.main(CreateStoredProc.java:37)
Caused by: java.sql.SQLException
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 10 moreDriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");check with ur sys admin wheather the particular user in the database has >execute privilage(rights) also.i mean execute the SP in the DB level.I guess that a root user will have the enough right.
String q = " create procedure runproc() "+
" define i int; "+<" let i = 0; "+
" end procedure; "+
" execute procedure runproc(); ";
Statement stmt = conn.createStatement ();
stmt.execute (q);Try to use the following code:
String q = " create procedure runproc() "+
" define i int; "+
" let i = 0; "+
" end procedure; "
Statement stmt = conn.createStatement ();
stmt.execute (q);
q=" execute procedure runproc(); ";
stmt.execute (q);
Because maybe the driver failed to precompile your sql once, so that nothing happen.
Maybe you are looking for
-
Do I need to have an external hard drive that has a certain spindle speed, like 7200?
In the past, when I did audio or video editing, the specs on the software required a certain rotational speed if I were using an external hard drive. Most of the time it was 7200. Do I need to use a specific spindle rotational speed for Final Cut Pro
-
Closing the report background engine
hi friends, i have tried using add_parameter function with ORACLE_SHUTDOWN=YES BUT THE Engine doesn't close in fact it shows the first report as in prview and the another report which I am trying to run in forms as waiting. is there any particular se
-
How can i texture just 1 face of a cube?
Im wondering how i could just set a texture to the TOP face of a cube Edited by: newber on Jul 10, 2008 4:38 PM
-
What is the max RAM for Satellite Z930-12Z?
Hi, im need to know the maximum ram amount for the Toshiba Satellite Z930-12Z. The toshiba website tells me it is selled with 2 x 2048 and you can expand up to 6 gb ram with replaycing one dim with 4 gb. but on the kongston website there is a 8gb dim
-
Help! ipad stuck in recovery mode after itunes error 6
so I was gonna update my ipad 3 from 6.1.2 I think, to 7.0.4 but I got the error 6 in itunes. now my ipad is showing the connect to itunes symbol and itunes wants to restore my ipad, which I wouldn't wanna if there was any chance to get it out of tha