Stored Proc accessing remote db: works locally, fails once uploaded!
Hi Everybody,
My servlet can access a remote stored procedure on our server when running on the local machine, as soon as I upload it and try to run the servlet on the server I get the following error when trying to access the stored procedure:
500 Servlet Exception
java.lang.NullPointerException
at com.mysql.jdbc.StringUtils.indexOfIgnoreCaseRespectQuotes(StringUtils.java:948)
at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1255)
at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:3640)
at com.mysql.jdbc.CallableStatement.determineParameterTypes(CallableStatement.java:506)
at com.mysql.jdbc.CallableStatement.<init>(CallableStatement.java:401)
at com.mysql.jdbc.Connection.parseCallableStatement(Connection.java:4072)
at com.mysql.jdbc.Connection.prepareCall(Connection.java:4146)
at com.mysql.jdbc.Connection.prepareCall(Connection.java:4120)
at core.TwistedDBC.TestSP(TwistedDBC.java:208)
core.TwistedDBC.TestSP(TwistedDBC.java:208) bieng the following line of code:
208: CallableStatement cStmt = con.prepareCall("{call Test(?)}");209: cStmt.registerOutParameter(1, Types.INTEGER);The line of code I'm using to connect is:
207: con = DriverManager.getConnection("jdbc:mysql://SERVER-NAME/SERVLET-NAME?noAccessToProcedureBodies=true", USERNAME, PASS);I set noAccessToProcedureBodies=true because we are on shared hosting with a Virtual JVM and I don't have rights to grant permissions.
I thought that I may have been able to execute the procedure as localhost, but when I ran "SHOW PROCESSLIST" from the local version of my servlet it displayed that I'm connecting via my ISP's IP address. When I did the same for the Remote version it displayed that it was using the IP address of my hosting company.
So, when my local version of the servlet (http://127.0.0.1:8084/Servlet-war/Servlet)runs, it returns "8" which is correct, but upload all the files to the remote server (http://myserver.com/Servlet-war/Servlet) and I get that error when trying to run from the url.
Any clues, thanks.
Seems likely that there is a bug in the driver.
Probably a rather exotic one since it seems likely that others have been able to use procs with MySQL.
Some debugging notes
1. Are you sure that the driver version on your local box is the same as that of the server? There is a meta data method(s) to determine that.
2. Have you verified the code that you are looking at is the same as what is running?
3. Try making an explicit statement (get rid of the '?') to see if it works.
4. Are you using the latest released driver version?
Similar Messages
-
Hi everyone,
I've got a Flex application that works wonderfully when I test it on my machine locally. It uploads files and send variables to a PHP script (that inserts them into a DB) with no errors when I run it locally. As soon as I put it online, the upload continues to work but something between my Flex application and the PHP script fails because no data is committed to the DB. I know the PHP script works fine - not only does it work when I run the Flex application locally but when I go directly to the PHP file online, a new empty line is added to the DB.
I initially thought that this was a cross domain issue so I added the following to the root of my hosted account:
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*.MYURL"/>
<allow-http-request-headers-from domain="*.MYURL" headers="*" secure="false"/>
</cross-domain-policy>
I based this off of what I found online which seems to have done nothing for me. I'd also be happy to provide an error message but I don't get one when I debug.
Any thoughts would be greatly appreciated.Use a network monitor to see if the Flex app is truly requesting the right URL.
-Alex -
How to migrate stored procs accessing columns "LEFT" and "RIGHT"
Hello!
I have to migrate a SYBASE11-Database to Oracle 8.1.7.
How can I migrate Stored Procs that access tables that contain columns 'LEFT' and 'RIGHT'?
OMWB reports a parse error "encountered: ,". If ommit the words 'left' or 'right' or if I write 'left()' or 'right()', it works. But I have to use these columns and we cannot change the database model.
It doesn't work with quoted column names like this: "LEFT" or "RIGHT".
I use OWMB 1.3.1.0.0. Anybody any ideas? Thanks in advance.
Yours, Heiko KaschubeThis is a simple matter to fix.
As the words LEFT and RIGHT are treated as reserved words by the stored procedure parser, they cannot be used successfully as column names within Oracle PL/SQL.
In order to get the stored procedure to parse, you can append an underscore to all references to LEFT and RIGHT e.g.
left_
then right click on the stored procedure name and select 'parse procedure' from the drop-down menu. The procedure will now parse and the generated PL/SQL can be viewed within the Oracle model menu tab.
It will now be necessary to remove all the underscores previously appended to the words 'left' and 'right' from the PL/SQL version of the stored procedure in question. Again, this can be done within the Migration Workbench.
Hope this helps. -
Stored proc to accept parameters at prompt
How do you create a stored proc in SQL so that when run in desk you can input parameters?
I have a simple stored proc but when I create in deski always get an error saying that it expects '@DateStart'.
here is the sproc ive used:
CREATE Procedure [dbo].[sp_redempt](@DateStart Datetime,@DateEnd Datetime) AS SELECT *
FROM redempt
WHERE planners.office = 'abc'
AND ProcessDate >= @DateStart and ProcessDate <= @DateEnd
-- running it in SQL ent mgr
exec dbo.sp_NCLredempt '01 february 2011', '28 february 2011';
can you help with the syntax I use or specify a simple stored proc using the adventure works DB that will prompt for a parameter in deski?
BO Edge XI 3.0
App server: MS Win2003 Server Standard SP2
DB server: MS Win2003 Server Standard SP2
DB on DB server: SQL 2005Hi,
this is not the best place to post this but you may try the SQL Server forums from Microsoft.
Might be an issue in your parameter type definition. What you can do is in
SQL Server Management Studio, go to the stored procedures (programability) under AdventureWorks database, and Right click -> Script Stored Procedure As -> CREATE to -> New Query Editor Window. Then there you will able to see the syntax how it's used.
You can run one sample procedure in Deski. In Designer create a secure connection to AdventureWorks database. Then create a Deski report based on the "uspGetManagerEmployees" procedure and you can use MnagerID 6 when you run it. You will get results. -
Portal failed to access remote resource due to network failures
Hi,
We have a portlet that allows users to upload files to a SQL Server database and make it available for other users to access. The portlet code is on our remote servers. Everything works fine in dev environment, but certain files fail in pre-prod and prod within the portal, but work fine when the code is executed outside the portal.
I keep getting this error:
Error - Portal failed to access remote resource due to network failures. Try again later or contact your portal administrator.
What could the problem be?
Thank you for your help.
RadIf the Studio service looks good on the remote server where Studio is installed (check that
the service is started and look in the Studio logs for any warnings or errors), you should
also verify the configuration settings in the Studio remote server object. Is it properly
configured and pointing to the correct remote server?
If so, check the portal servers access to the Studio server via the port specified in the remote
server (default is 11935). You can test this by doing a telnet test on the portal server. In a cmd
prompt (Windows) or on the CLI (Unix), type 'telnet [studioserver] 11935', where "<servername> is
the name of your Studio remote server. The screen should just go blank, meaning that there is
something accepting connections on that port on the given server. (We would hope it's the Studio
app and not another service occupying that port.) If you get "Could not open connection to the host"
or some such similar result, check that the network between the portal and the Studio remote server
is open (ie, make sure there isn't any port blocking or a firewall in place that would hinder the
communication between the two servers). -
FPGA Compile error on remote compile worker - but not on local!?
When i compile using Rebuild for building my VI to FPGA on NI cRio-9082 I get this:
Then I kill the compile worker on the develop machine, to use remote compile worker.
Then i get this:
Should the timing constrains not be the same?
Last lines in Xilinx log:
Process "Generate Post-Place & Route Static Timing" failed
done.Mauritius,
Brad and I took a closer look at the Xilinx log and we see a line printed that will hopefully help us narrow down the problem. Immediately after completion of the Analysis phase the log has the following line recorded:
*** glibc detected *** /usr/local/natinst/NIFPGA/programs/xilinx13_4/ISE/bin/lin/unwrapped/trce: double free or corruption (!prev): 0x09fd05e0 **
It seems there is a problem with the linux worker attempting to free the same memory twice which may be causing the compiler to exit during the mapping phase. We have a few more questions and would like to take a closer look into things for you.
1. Will any other designs compile succesfully on this linux worker (even very basic VIs)?
2. If other designs compile, will a simpler version of this design still fail consistently?
3. If the failed compilation seems to be design specific, would you be willing to provide your design for us to try and reproduce the failure?
Feel free to personal message me if necessary.
-Nick-
Nick C | Staff LabVIEW Platform Product Support Engineer | National Instruments -
Business Objects XI R2 - Oracle Stored Proc - Deski report failing
Business Objects XI R2
Hi All,
I have a stored proc created in Oracle 10 - see bottom for code
I run a deski report on iit - using it as a datasource. This works fine in Desktop Intelligence until I schedule the report from infoview - then I get the following error...
"Object failed to run due to an error while processing on the Job Server"
My other deski reports based on Universes are ok.
create or replace procedure test_PROC1
(Test_Rpt_Cur OUT SYS_REFCURSOR)
is
begin
open Test_Rpt_Cur FOR
SELECT ID, FIRSTNAME, LASTNAME
FROM test_table;
end test_proc1;Hi,
Cause of this issue :
Once the Job Server recieves the scheduled job and spawns a new child process, the child process is unable to complete the job. The child process constantly is waiting to load the job. Looking further into the log and specifically the startup script, the -port option was incorrectly used (-restart-port) and didn't allow the child process to bind to the correct port using the correct DNS name.
In Order to resolve this issue follow the steps given below..
1.Open CCM
2. Stop Server
3. Right Click Server and go to Properties
4. insert -port option in to command line, example below
ex. "
win2k3\C$\ProgramFiles\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\JobServerFullClient.exe" -service -name win2k3.Desktop_IntelligenceJobServer -ns win2k3 -objectType CrystalEnterprise.FullClient -lib pp_procFC -jsTypeDescription "Desktop Intelligence Job Server" -maxDesktops 0 -restart -port win2k3.it.bo.example
5. Save setting and restart server.
Hope it helps.
Regards,
Sandeep Singh -
My machine is Top of the range (my Company builds them so it had better be :) )
Amd 1100t , 8gb ram , Windows 7 64 bit etc, etc...
The is not a hardware problem , but a software problem with FF...Any help would be appreciated as I hate using IE 8 for anything at all :( but I have to keep it on my machines just to run my remote security cameras at my Computer shop ???
Original question...as question length is limited ...not very bright that limit by the way :(
"My DVR security sofware that I access remotely uses a "dvr .ocx" file....when I try it in Firefox , either the latest non beta (3.6.1.5) or the new beta version (4.0 rc) it will NOT work as it says the plugin is missing... it works in IE 8 (unfortunately) but not IE9...
As I own a Computer company I am fairly computer literate but cannot find a plugin that allows this to work in Firefox.... but I would have expected it to work in the new Firefox :(
All the best, Brett :)The longer this thread continues, the more ancillary comments you throw in that aren't directly pertinent to your problem with your DVR software not working with Firefox 4.0. Sorry, I don't intend to continue with this discussion.
I do agree that ''something'' needs to be done better with regards to plugins for Firefox, but I do disagree with you as to whose responsibility that ''something'' is. -
Error committing transaction in Stored Proc call - prev solns not working
Hi All,
Our process invokes a DB adapter to fetch the response from the table for our request via Stored Procedure call but facing the below issue. Its a synchronous process. Stored Procedure is present inside the Package and we are calling the Stored procedure using that Package.
What we did is created a DB datasource of XA type and tried to call the Stored Proc but it was giving a problem “ORA-24777: use of non-migratable database link not allowed” and hence according to this thread Using DB links in Stored proc call in DB adapter 11G SOA we have modified the datasource as non-XA type.
While we do that, we could see that Stored Proc is called and the response is present in the reply payload inside the flow trace. But the instance is getting faulted and the error is “Error committing transaction:; nested exception is: javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a participant in two-phase commit. To force this participation, set the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source.”
We have tried the properties of global transaction support as one phase commit, emulate two phase commit and logging last resource but error remains the same.
Database from which we are getting the response is of version "Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production". Will the database link error arises even if we connect to Oracle Database?
Please could you advise me solutions to resolve this issue.
Thanks in advance.You are using Non-XA because it means (among all others) that the commit issue can be handle by the DB as well.
The Emulate Two Phase property imitating the XA transaction in that way, that it allows you to manage a local db transaction.
You can stay with XA connection, but then you will have to use "AUTONOMOUS_TRANSACTION pragma" in your procedure.
Enter the following link to find good explanation about all of your questions:
http://docs.oracle.com/cd/E15523_01/integration.1111/e10231/adptr_db.htm#BGBIHCIJ
Arik -
My Mountain Lion app failed while downloading, and now I can't download it without repaying for it. How can I get my access code to work/download the app?
Welcome to Apple Support Communities
Open App Store, select Account in Quick Links and press Show hidden purchases. If OS X isn't there, http://www.apple.com/support/mac/app-store/contact -
Using Java within a stored proc to access multiple database connections
Hi List;
We have an environment where we have needs to provide cross database visibility between Oracle, Sql Server and PostgreSQL. So we need the capability for Oracle to query PostgreSQL and Sql Server tables, PostgreSQL must be able to query Oracle and Sql Server tables and Sql Server must be able to query Oracle and PostgreSQL tables.
I'm thinking that we can implement stored procs which are either written in java or call a java process . The java code in turn should be able to connect to any DBMS desired via JDBC query the tables in question and return the result set to the calling database.
Any thoughts on how feasable this is would be appreciated. Does this seem like a solid solution? Any initial concerns or red flags? what about performance via JDBC?
Thanks in advance for your help.John,
from your description I understand that you essentially program the VO yourself. So I suggest that you read chapter 35.9 of the 'Fusion Developer’s Guide for Oracle Application Development Framework' (I guess you know where to find it). Since you still call the actual SQL not all of the chapter apply, but you get the idea how it works.
And yes you analyzed the behavior correct. executeQueryForCollection() is allways called bevore getQueryHitCount().
Timo -
HT1338 can apple remote desktop 3 access my pc work desktop?
can apple remote desktop 3 access my pc work desktop? Do I have to get microsoft office 2011 in order to do this?
Microsoft Remote Desktop Connection Mac OS X Client (free)
<http://www.microsoft.com/mac/products/remote-desktop/default.mspx]]>
Applications -> Remote Desktop Connection
Computer: windows.pc.address
-OR-
Computer: windows.pc.address/console
Microsoft provides setup instructions on the web page where you download the RDC client.
-OR-
CoRD (Microsoft RDC Screen Sharing)
<http://www.macupdate.com/info.php/id/22770/cord>
-OR-
You could also install a VNC server on your Windows system and use a VNC client on your Mac -
Flash Remoting Works Locally But Not On The Server
Hello,
I have a flash file that connects to an asp.net page. The
aspx page queries a databse and returns a set of records to flash.
Flash reads in those records and processes those records. Locally,
this works fine. However, on the server, nothing happends. I spoke
with tech support at hosting company and they tell me everything is
installed for Flash Remoting.
Here is the code thats on the server:
import mx.remoting.NetServices;
import mx.remoting.NetDebug;
mx.remoting.debug.NetDebug.initialize();
//CONSTRUCTOR
var inited:Boolean = false;
if(!inited){
inited = true;
NetServices.setDefaultGatewayUrl("
http://63.134.251.243/gateway.aspx");
var gatewayConn
bject = NetServices.createGatewayConnection();
gatewayConn.setDebugID( "Gateway Connection" );
var SQLQueryToolService
bject = gatewayConn.getService("matthewlemke", this
function SQLQueryToolAction(){
SQLQueryToolService.test("SELECT * FROM flashImages");
function test_Result(result){
trace(result);
_root.abc.text = result.toString();
SQLQueryToolAction();
Here is the code locally:
import mx.remoting.NetServices;
import mx.remoting.NetDebug;
mx.remoting.debug.NetDebug.initialize();
//CONSTRUCTOR
var inited:Boolean = false;
if(!inited){
inited = true;
NetServices.setDefaultGatewayUrl("
http://localhost/matt/gateway.aspx");
var gatewayConn
bject = NetServices.createGatewayConnection();
gatewayConn.setDebugID( "Gateway Connection" );
var SQLQueryToolService
bject = gatewayConn.getService("matt", this );
function SQLQueryToolAction(){
SQLQueryToolService.test("SELECT * FROM flashImages");
function test_Result(result){
trace(result);
_root.abc.text = result.toString();
SQLQueryToolAction();
Any help is greatly appreciated.
Thanks,
VicI am having the exact same problem. My remoting application
works fine on my laptop as long
as the url for the gateway reads
http://localhost/remotingData/gateway.aspx,
but if I change
it to the name of my machine and attempt to run the swf I
keep getting a NetConnection.call.badversion error in the
netconnection debugger. If I attempt to connect through IE it just
sits with no reply.
Is there some kind of permission thing going on here?
Flash MX2004 Professional
Flash Remoting Components MX2004 (unlicensed)
IIS 6.0
IE 6.0 -
Failed to access remotely to cam PVC2300
Hi, I'm having a issue accessing remotely to 5 cameras through Internet.
I enable different port to each camera (1024, 1025 and so on), i'm using static LAN IP for those cameras (even try using DHCP). I enable DDNS with my current domain, user and password.
For my WAN service have a 2wire DSL Router with a dynamic IP.
I already update the firmware on the cameras thinking that could be an issue.
My problem is when i try to access using my "domaintocameras.xxx" does not giving any response. I try accessing disabling the port and using only the domain or enabling the port using "domaintocameras.xxx:1024".
On the router I enable the DMZ option for the camera MAC address, when I do that I can have access but using my current WAN IP.
First I thought that could be a 2wire or ISP problem but then enable the DMZ on the 2wire for a Linksys Switch (srw2024P) which does not support by itself the DDNS option and have access remotely to my switch using my domain registered on dyndns.
Basically all of my tests were connecting directly to my 2wire one of the cameras and making test and configuration.
I check on the dyndns website which WAN IP is giving me and it match to my current WAN.
Even if a make a ping test to my current domain I get access to my current WAN IP.
On the camera configuration parameters I enable the static IP address.
The only difference that I configure on both devices were the DNS:
For the switch enable the IP and as a gateway the router IP. The DNS configure the DNS that my ISP have.
For the cameras enable the IP's, as a gateway the router IP (due it is directly connected to the router) but the DNS configured the router LAN IP.
Please help!These products are being handled by the Cisco Small Business Support Community. (URL: https://supportforums.cisco.com/community/netpro/small-business)
-
[AS3] EventDispatcher works locally but not remotely
Hi,
I am very new to Action Script and have the following
problem. I hope someone can point me in the right direction.
I have a small video player app. I have added the FLVPlayback
component to the stage and set some properties via action script
(AS 3)
I then instantiate a class to go and retrieve some XML,
register an eventListener to wait for the XML to be loaded and once
the event has fired, load the FLV file (just hard coded at the
moment) into the FLVPlayback object.
This works when testing in the Flash IDE but not when I
publish the movie to my webserver. I have tried commenting out the
player.load() and just adding a textfield and again this works
locally but not when I publish to the webserver. I have included
some code snippets below.
Can anyone tell me where I am going wrong?
Any pointers much appreciated.
Thanks
MartinHi,
I found the problem if anyone has the same issue. I was
passing some FlashVars in incorrectly using the
AC_RunActiveContent.js that comes with Flash. I have switched to
swfobject and all is well.
thanks
Maybe you are looking for
-
Hello, I'm trying to sync my iphone with my itunes on my computer but it comes up with a message saying 'cannot connect to this iphone as the newest itunes needs to be downloaded'.. i downloaded this to my computer but whenever i open itunes it looks
-
How do I add one event to multiple, but not repeating, dates
I routinely need to add single events to 10 to 20 dates at once. These dates rarely line up in a repeating sequence. For instance I may need to schedule "appointment with John at 1pm" on M,Tu this week; W,Thu,Fri next week; M,Thu the following week.
-
Help with Oracle Connection- "Input string was not in a correct format"
Hello, can some one, anyone please help me. I have a simple VS 2005 C# application that connects to oracle. I've set it up to take the username, password and tnsname as arguments. I am using Client 9i, version 9.2.0.401 of Oracle.DataAccess.dll, and
-
Need to create stupid proof templates for non-designers
Ok folks, I'm new to this forum having come across it in search of a solution to my problem. I need to create illustrator template files (.ai not .ait) that customers can download and use to create their own artwork for print. I have to create them i
-
HT1766 How do I get my song off computer and onto Iphone 4gs
I can not figure how to sync my Iphone4gs to my laptop to transfer my music on to my phone. Please help