How to make Database calls without directly htting the DB Listener?

Hi
I have a frontend end (code sitting on user's PC) application that needs to call the database, say, to look up table data and populate a JTable.
So, I make a call directly to the database, on the default 1521 (yes, it's Oracle!) and get my data. However, I have other server side java code connecting with my application over a Java socket. (sending messages back and forth).
So, I've got two ports open, 3041 (arbitrary ) for the Java socket and 1521 for the DB.
I want to close 1521 and move the sql statements to the server.
I can't work out a way to do this effectively. At the moment, I'm sending a message through 3041 to tell the server side code to perform a DB call. Then the database returns the info and I send a message back to the client PC with the data.
It makes the DB call asynchronous (good or bad thing?), since I have a listener on the client waiting for messages from the server.
It all looks a bit messy....ie sending messages and waiting for replies just for a DB call.
Is there a standard practice for my problem that I can use?
Thanks

Your script won't work.
#Renamed the variable so that it's less confusing.
$webUrl = "http://spsite"
#There's no point getting the SPSite object if you only want/need the SPWeb object.
#$spSite = Get-SPSite -Identity $mySiteUrl
#$spWeb = $spSite.OpenWeb()
$spWeb = Get-SPWeb $webUrl
#You've copied this from an example that uses a subsite which has the documents. That's not a great approach and probably not valid for yours
#$cvDocumentLibrary = $spWeb.GetList("subsite/Documents")
$library = $spWeb.Lists["ListName"]
#Here you are referencing '$lib' which hasn't been declared. PowerShell will be completely ignorant of what on earth that is and will throw a null reference exception
# $item = $lib.Items | where {$_.Name -eq "Report.docx"}
#This still isn't perfect as it's slow and won't work on lists that are over the throttling limit but it'll work most of the time.
$item = $library.Items | where {$_.Name -eq "Report.docx"}
$item.Delete()
You need to slow down and check things.
$webUrl = "http://spsite"
$spWeb = Get-SPWeb $webUrlWrite-Host "The URL of the website is: " $SPWeb.URL
$library = $spWeb.Lists["ListName"]
Write-Host "The Library title is: " $Library.Title$item = $library.Items | where {$_.Name -eq "Report.docx"}
Write-Host "Deleting item named: " $item.Name$item.Delete()
In that version it should print out some lines as it processes which will confirm that you've found the web, list and item before it does anything.
If you hit errors post up the EXACT code you're using, change the URLs a little bit if you want but try to only replace words rather than missing out whole chunks.

Similar Messages

  • How to make a .exe without errors about the costum scaling

    Hello everybody,
    i'm new with Ni-Labview,
    i'm trying to make a .exe file of my application, this is working perfect, but if i make costum scales in my Daq Assist options and i make the vi in a .Exe then there are always errors if i open it on another computer... if i put every Daq Assist box to the ''no scale'' option, then the exe is working on another computer...
    it is working good on the computer where i build the vi on...
    but of coarse i'm not planning to put the hole software (labview) on that other computer... that's where the .exe file is for i guess...
    i have 1 Daq Assist that is programmed with a scale that converts 0-5 volts to 0-3000(rpm)  this is a output voltage
    and the other daq assist box is programmed with a scale that 0-1volts is 0-3000(rpm) this is a input voltage
    everything is working like i want it to work on my computer where i build the application, but if i make a .exe file of it, including all the Daq Mx drivers and so on then this file is not working.... so i made a error box at the end of the daq assist to see what is happening and if i open it then on another computer then it tould me that there where errors with the scaling i made... but i don't see the problem????
    is anyone having this problem also? or maybe i do something wrong????  i really don't know how to solve this problem... and it should not be that hard,... i'm sure of it....
    hope someone could help me....
    i use a Ni-USB 6211
    thanks for reading this and hope to hear something soon!
    thanks
    Kind Regars,
    Kris

    Hello There,
    i have one more question that i can't figure out....
    i have a vi in attachment that you can open hopefully....
    in the block diagram you see 1 Dial, this is the left dial in the screen... now this is the setpoint of the PID regulator..
    what i want is a Analog input to be the Setpoint of the PID Regulator Also... i prefer to have little button or something so i can choose what i use , or the Dial on the computer(with the mouse)  Or a Analog input from external device 0-10V input
    i have try'd a lot of things but the only thing that is everytime popping up:
    Possible reason(s):
    NI Platform Services: The specified resource is reserved. The operation could not be completed as specified.
    i can't solve it..... is there anybody who have an idea how to put things straight and working?
    Thanks!
    Kind Regards,
    Attachments:
    PWM Module TEST1.vi ‏117 KB

  • Newest iTunes update: screen size is blown up. How to make it normal without messing with the computer's dimensions

    Ok, so before the big change in iTunes, the iTunes window fit perfectly on the screen and there were no issues. Now, the iTunes window is blown up largely where I cannot even see my scroll bar. Even if I change the dimensions of the computer screen, nothing is working. Help!

    Resize the iTunes Window.

  • How to enable PIN authentication to make outgoing call , without login?

    Hi experties,
    In my organization, there are 2 type of user defined by management, which is user uses Extention Mobility(Login/Logout) at any IP Phone and the other side is users uses share ip phone as common number. each user have their own login profile, but how can i enable the sharing user do not have to login but they can uses their PIN to make outgoing call without login to ip phone. This features we normally found in analog phone where each user have personal PIN for outgoing call. for your infomation we're using CCM4.1(3)sr3c and IPPhone 7940 and 7960..Thanks in advance..

    It sounds like you want to use Forced Authorization Code. On the route pattern out check 'Require Forced Authorization Code' and set a level. Callers using the route pattern will now be prompted to enter their code with 3 beeps. Go under Feature-Forced Authorization Code and create some codes. If the codes are the same or higher level as what is assigned to the route pattern the call will go out.
    Don

  • How to make a call  to service from site studio templates?

    Hi,
    May be this is very basic but I am not able to figure out how to make a call to a service from site studio templates (hcsp). I have seen one example of service call in the dynamic list fragment. It makes a call to SS_GET_SEARCH_RESULTS service using executeService() method. But it doesn't take any parameters and also not very how returned results are captured.
    I want to execute WCM_PLACEHOLDER service. It takes 2 main parameters dataFileDocName and templateDocName. The returned result is typically a html response.
    The service typically is executed using http request and the url would be something like this
    http://hd-pratapm/ucm/idcplg?IdcService=WCM_PLACEHOLDER&dataFileDocName=VIRTUSAINC&templateDocName=DETAILS_REGION_TEMPLATE
    I think SS_GET_SEARCH_RESULTS service works in the similar fashion. I want to execute WCM_PLACEHOLDER service too using executeService() method. How to work with this? How can we pass parameters and capture returned results?
    Regards,
    Pratap

    Hey Pratap,
    If you are on a standard Site Studio template (page or subtemplate) you should be able to call the wcmPlaceholder idoc function directly. In fact calling the idoc function provides a lot more functionality then the service call (they locked down a few things in the service call since it is designed to be called from an external application).
    The idoc call would look something like: <!--$wcmPlaceholder("Sales", "placeholderDefinitionDocName=placedef_salescontact")--> (taken from page 208 in this doc: http://download.oracle.com/docs/cd/E10316_01/SiteStudio/10gr4/Pdf/Site_Studio_10gR4_Designer_Guide.pdf)
    As a general note when you are in idoc script and want to execute a service you call <$executeService()$> as you saw in the dynamic list. The parameters that the service runs on are in the data binder of the current request. To set parameters for an execute service you simply set idoc variables on the page before it. Example:
    <!--$QueryText="dDocType <matches> `Document`" -->
    <!--$executeService("GET_SEARCH_RESULTS")-->
    As for the response when you execute an idoc function, like wcmPlaceholder, that returns a String the response is immediately output to the page in the location you called the function. This would be similar in concept to a jsp scriptlet that outputs a string <%=myResponseString%>
    Hope that helps,
    Andy Weaver - Senior Software Consultant
    Fishbowl Solutions < http://www.fishbowlsolutions.com?WT.mc_id=L_Oracle_Consulting_amw_OTN_ECM >
    Edited by: Andy Weaver on Jul 7, 2010 7:59 AM
    Added response detail.

  • How do I import an image directly from the internet without printing and scanning it in first?

    How do I import an image directly from the internet without printing and scanning it in first?

    You can also Ctrl click on the image, save the image to your desktop and open it in Photoshop.
    1.
    2.
    3. Open in Photoshop by double-clicking on the saved image on your Desktop or Cmd o in Photoshop.
    I don't see any point to copying and pasting from a browser into a new file in Photoshop.
    If you want to put an image onto an already open image in Photoshop, use the File > Place... command and select your saved image.
    Gene

  • How to make a redirect without auto-redirect from the portlet "edit" mode?

    How to make a redirect without auto-redirect from the portlet "edit" mode?
    I use some sofisticated customizing with server-side validation of the form data. I want to redirect to the page of the portlet "show" mode and to the "edit" mode depending on the validation results. How can I do it?

    Heay.....this worked for me.
    I am able to change the mode programatically from edit to show.
    HttpPortletRendererUtil.handleEditAction(portletRenderRequest,"OK");
    I removed Apply , OK and Cancel buttons and applied my own Submit and Back button in Personalize mode and then change the mode to show on click of Back button using the above mentioned statement.
    Thanks
    ~Neeraj Sidhaye
    Try_Catch_Finally @ Y !
    ExtremePortal @ Gmail&#12288;&#65316;&#65359;&#65364;&#12288;&#65315;&#65359;&#65357;

  • I have 3G sim card how to make reugular call in ipad air 4G. tell me.

    i have 3G sim Card how to make regular call in ipad iar 4G. tell me.

    You have to use an app such as Skype or Viber. iPad has no
    telephone capability as sim is data only.

  • How to make system call to execute command line in JAVA?

    Hi,
    I am new in JAVA. How to make system call to execute the following command line in JAVA in LINUX environment.
    rpm -qa jdkIn C programming, use as such:
    system ("rpm -qa jdk");
    How about JAVA?
    Thanks.

    Runtime.getRuntime().exec. But first read this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How to make things fly without a greenscreen in Motion 5

    How to make things fly without a greenscreen in Motion 5

    green-screen = color-key is just one method to 'punch out' the wanted parts of a pic from the unwanted.
    other methods:
    • luma-key: object is in front of a plain black (or white) background ...
    • alpha-key: 'object' is a computer-generated image, rendered with an alpha-key
    • rotoscoping: you mask the the object by hand from the unwanted parts.
    ...and 'fly' is just key-framing the scenery so it looks like the object is hovering over all .........
    very unspecific question, hm?

  • How to make video calls on i phone 4s

    how to make video calls on i phone 4s

    kalidag
    Currently Being Moderated  Re: how to make video calls on i phone 4s
    Jan 30, 2012 1:35 AM (in response to wjosten)
    but we can make video call using our SIM network.. it charge morethan a voice call.I am looking for that on my i phone
    Dear cheonweb,
    The person asking about  3G video cal with out using GPRS(cellular network data plan or wifi) by using cellular network data plan it is possible but with out using cellular network data plan we cant make 3G video cal in apple phones.

  • How to make Conference Call in Xperia Z1

    How to make conference call in Xperia Z1. First of all I am not sure whether that facility is available in Z1. 

    Hi and welcome to the community! Since you're new please be sure that you have checked out our Discussion guidelines.
    I suggest that you take a look at the following link for further instructions about how to place conference calls:
    http://userguide.sonymobile.com/referrer.php?region=gb&product=xperia-z1#Conference-calls.html
    Note that this function needs to be enabled at your subscription from your operator in order to make it work.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • How to make CSD call in NOKIA E71

    Hello,
    I bought two Nokia E71 mobiles with BSNL 3G connection. My service provider(BSNL) providing 3G service. E71 is connected to PC there i dialed to another phone which is conneted to other PC. when i dialed from hyperterminal in winxp by using ATD commnad with out semicolon. I am getting connection error messge on my phone. NO CARRIER on hyper terminal.
    I don't know what the problem is i tried with all commands no use. Is there any setting required for NOKIA E71. How to make data call (CSD call) by using Nokia E71.
    You help is very much appreciated..
    -Vijender

    Hi
    this may or may not be of help.
    I was having a similar problem with a 6230i.
    When trying to make a data call  the No Carrier signal would come back.
    After some research I changed +cbst form 0,0,1 to 7,0,1
    at+cbst=7
    This apparently gives the receiving modem more time to connect. It sends the no carrier signal 30 seconds later after appearing to connect, I still dont get the connect 9600 response.

  • Is it possible to make international calls without...

    Is it possible to make international calls without an unlimited plan? If so, what are the skype credit rates for US to UK calls? And do I need to do anything special to set up this ability?

    Hi,
    http://www.skype.com/intl/en/prices/payg-rates/?currency=USD#cc=GB
    http://www.skype.com/intl/en/prices/payg-rates/connection-fees/?currency=USD#cc=GB
    Hth
    On ne regarde pas l'avenir dans un rétroviseur !
    IMac Intel Core i3 3.2 GHz - RAM 12 GB - OS 10.10.3
    Skype 7.8.391
    Logitech usb headset or Jabra 250 bt

  • How do I move a file directly from the desktop to a folder in OX 10?

    I am new to Mac and the Mountain Lion software.  Having worked exclusively with PC operating systems, I am familiar with how to work with files in Windows, but am having trouble doing similar actions in OX 10.  How do I move a file directly from the desktop to a folder in OX?  Although this answer is likely in a video tutorioal (somewhere), I do not have the time to sit an arbitrarily watch generic OS videos that give a broad brush overview, without answering specific queries.  Any help out there?

    You might fun http://www.apple.com/support/macbasics/ to be of help to get used to doing things the Mac way.
    Allan

Maybe you are looking for

  • Creative cloud photoshop blur tool not work as it should be

    creative cloud photoshop blur tool not work as it should be ! I go to blur a painting i am doing and it does not blur enough and I am using wacom Intuos 5 med pen tablet. and I even set the tablets sensitivty for pressure lower then default and still

  • Layout which is not user specific

    Hello All, Can I save a layout as a default layout for all my users. Actually its not my code its the output of std report RCS15001. I want to save my layout as not user-specific but the checkbox is greyed.Kindly help me out. Thanks in advance, Regar

  • Service not working so well anymore

    I'm at a bit of a loss where to start here. It seems that lots of things are starting to go slow or break with my bt broadband. The broadband phone on the home hub has stopped working a couple of months ago and recently, after buying a new tv, we tri

  • Can I run a CLDC app on the toolkit ?

    Hi, How can I run a CLDC app on the Sun Java Wireless Toolkit? All the documentation seems to talk about running MIDlets only. -Sankar

  • Now Entourage keeps crashing

    I upgraded to OS 10.4.9. Now Encourage (v. 10.1.6) keeps freezing and gives me error message -192 ("resource not found"). Entourage worked fine before the upgrade. What's the problem and how do I solve it?