Jdbc - get DB instance name
I'm connected to an Oracle RAC Database by jdbc thin connection. On jdbc URL I setup the database name.
Is it possible to know on getConnection which instance i'm connected? When I get connection I don't know if session from cached pool is on Instance 1 or instance 2.
Thanks a lot
Connection c=null;
c = MyDataSource.getConnectionDataSource10g().getConnection();
Perhaps you could execute a query against the database that uses some Oracle function that returns the instance name? I'm not an Oracle expert (and this isn't an Oracle forum) so I have no idea whether such a function exists.
Or let's try this: why do you need to do that? Maybe that's just a bad solution for some other question you didn't ask here.
Similar Messages
-
Get All instance names in the stage
hi,
is there any way to get all instance name of the objects presents on the stage ? trace them for example
thank youthank you, it's the correct answer but i still can't solve my problem ,
the thing is that am using a code from http://www.freeactionscript.com that make enemie follow the player, but i need to do some modification, i need to detect collision between enemies so they will not get the one into the other and the thing that i cannot found their instance name, even when i used your function i only get "player_mc : _level0.player_mc" at the output,
here is the code, i will be really greatful if you can find a way to help me solve this problem .
ps :
am trying to write my own code that make enemie follow the player, coz this one looks very complicated
thank you
the code :
* Game Enemy AI Behavior - Run Away & Follow Player
* Version: 1.0
* Author: Philip Radvan
* URL: http://www.freeactionscript.com
var enemiesArray:Array = new Array();
var radians:Number = 180/Math.PI;
createEnemies(5, "typeA", "e1");
createEnemies(5, "typeB", "e2");
createEnemies(5, "typeC", "e3");
// createEnemies(number of enemies, behavior)
// use ex: createEnemies(10, "slow", "myLinkedMovieClip);
function createEnemies(enemyAmount:Number, enemyBehavior:String, enemyLibraryClip:String):Void
//run a for loop based on the amount of enemies
for(var i = 0; i < enemyAmount; i++)
//set temporary variable that will hold the new enemy attributes
var tempEnemy:MovieClip = _root.attachMovie(enemyLibraryClip, "enemy"+_root.getNextHighestDepth(),_root.getNextHighestDepth())
//give new enemy a random x/y position based on stage width/height
tempEnemy._x = random(Stage.width);
tempEnemy._y = random(Stage.height);
tempEnemy._rotation = random(360);
//set enemy behavior
if(enemyBehavior == "typeA")
//define enemy characteristics
tempEnemy.speed = 1
tempEnemy.turnRate = .05
tempEnemy.agroRange = 200;
tempEnemy.mode = "follow"
else if(enemyBehavior == "typeB")
//define enemy characteristics
tempEnemy.speed = 4
tempEnemy.turnRate = .5
tempEnemy.agroRange = 200;
tempEnemy.mode = "follow"
else if(enemyBehavior == "typeC")
//define enemy characteristics
tempEnemy.speed = 1
tempEnemy.turnRate = .2
tempEnemy.agroRange = 100;
tempEnemy.mode = "run"
//define variables that are used to calculate following
//*don't change these*
tempEnemy.distanceX = 0;
tempEnemy.distanceY = 0;
tempEnemy.distanceTotal = 0;
tempEnemy.moveDistanceX = 0;
tempEnemy.moveDistanceY = 0;
tempEnemy.moveX = 0;
tempEnemy.moveY = 0;
tempEnemy.totalmove = 0;
//add new enemy to array
enemiesArray.push(tempEnemy)
//Update enemies function
function updateEnemies():Void {
//run a for loop based on the amount of enemies
for(var i = 0; i < enemiesArray.length; i++)
//set temporary variable that will hold the new enemy attributes
var tempEnemy:MovieClip = enemiesArray[i];
//run follow function with temporary enemy as the follower
updatePosition(tempEnemy, player_mc);
// updatePosition(follower, target)
// use ex: updatePosition(myEnemyMovieClip, playerMovieClip)
function updatePosition(follower:MovieClip, target:MovieClip) {
//calculate distance between follower and target
follower.distanceX = target._x-follower._x;
follower.distanceY = target._y-follower._y;
//get total distance as one number
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
//check if target is within agro range
if(follower.distanceTotal <= follower.agroRange){
//calculate how much to move
follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
//increase current speed
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
//get total move distance
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
//apply easing
follower.moveX = follower.speed * follower.moveX / follower.totalmove;
follower.moveY = follower.speed * follower.moveY / follower.totalmove;
//move & rotate follower
if(follower.mode == "follow")
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
else if(follower.mode == "run")
follower._x -= follower.moveX;
follower._y -= follower.moveY;
follower._rotation = (Math.atan2(follower.moveY, follower.moveX) * radians)+180;
//onEnterFrame that executes the updatePosition updateEnemies every frame
_root.onEnterFrame = function(){
updateEnemies();
//start/stop drag for player_mc
player_mc.onPress = function(){
startDrag(this);
player_mc.onRelease = function(){
stopDrag(); -
Get the instance names of clips attached to a movieclip
I want to get the instance names of all the cmovieclips that
are attached to a movieclip.
Is there a simple way to do this.
I imagine this is something that can be done with AS3 but can
it be done with AS2?
regards Jyou're welcome.
FYI: a for...in loop loops through all the accesible
properties (in the broadest sense of the meaning, includes
methods/functions and variables etc). Each time it finds one it (in
this case) assigns the property name to the variable 'unknown'
the code inside the loop just checks
a) is it a property that references a movieclip instance and
b) is it the same property name as the movieclip instance's
_name property (this is to avoid listing additional references to
the same movieclip instance that may be set up as variables in your
McA's scope).
I just read that and I'm wondering if it actually will help
you understand... its quite complicated to describe,sorry...
although its simple to understand once you get used to it. To learn
you should experiment with a few for.. in loops on different
objects and see what trace outputs you get. -
Hi ,
I have build a solutuon to send email invoce using BIP.
I want to prefix the DB instance name in email Subject on development/test instances.
Please suggest me how to get the DB name in BI publisher bursting control file.
<xapi:message id="1" to="${TO_EMAIL_ID}" attachment="true" content-type="html/text" subject="$
for exmaple: I have email with
subject: 74444555 - Invoice(20071429) notification
on my development box icprj01 I need email subject like
subject: ICPRJ01 74444555 - Invoice(20071429) notification
Thanks
KumarCan't do it in bursting. You will need to pull the db name for sql in a data template or reports6i. Sorry :-(
-
How to get object/instance name in method
Hi folks,
I have created a class and implemented a method within the class.
Now i would like get the name of instance/object calling this method ,within this method.
Is their any way to get this obj name within method?
Eg:
I hve class ZCL with method METH
Now in some program i used this method, by creating any obj
data obj type ref to ZCL
obj->METH
Now is there any way to get this obj name within the methodMETH by using some method like GET_OBJ_NAME(just making a guess)
Regards
PG>
PG wrote:
> Now is there any way to get this obj name within the methodMETH by using some method like GET_OBJ_NAME(just making a guess)
>
> Regards
> PG
Please check the below code snippet
DATA:
lref_obj TYPE REF TO cl_abap_typedescr.
lref_obj ?= cl_abap_objectdescr=>describe_by_object_ref( me ). -
Get server instance name without deploying weblogic.jar to client
I use wlclient.jar with my client. Using weblogic.jar instead causes the
size of the deployment package of my client to go from 4 meg to 34 meg
(roughly). I don't want full MBean functionality, all I want to do is find
out what the server instance name is. Surely there's a way to do this.Hi,
Weblogic provides you a way to create client jar files so that the complete weblogic.jar
doesn't need to be downloaded to the client. The tool is called verboseToZip.
See
http://e-docs.bea.com/wls/docs70/adminguide/utils.html#1117405
hope this helps, pat
"BEA" <[email protected]> wrote:
I am trying to deploy my client application on a standalone windows machine
and do not wish to deploy weblogic.jar with the client deployment. Is
there
any way of allowing my clients to use Weblogic JNDI without having to
deploy
weblogic.jndi.WLInitialContextFactory.class (and its associated classes.
I find it hard to believe that everyone who is developing on weblogic
distributes this JAR file to their customers with their client
applications....?
Can you use something other than weblogic.jndi.WLInitialContextFactory
such
as the sun jndi provider instead....?
If anyone can shed some light on this deployment problem it would be
much
appreciated.....even if its simply 'thats just the way you have to do
it
!......will save me time trying to get other solutions to work...!
TIA -
Get weblogic instance name in cluster env.
Hi, there, how can I get each weblogic instance name in cluster env. in my code?
thanks.
If you want the current instance name, it is 'weblogic.Name' I think. If you
want a list of all instances in the cluster, you can probably find it by browsing
WebLogic MBeans.
black <[email protected]> wrote:
> Hi, there, how can I get each weblogic instance name in cluster env. in my code?
> thanks.
Dimitri
-
How to get the instance name from the SWFLoader?
Hi Guys,
I am new to Flex. i need help from u.
i load the swf file through the SWFLoader in Flex 3.
Than how to get the instace(button,text,etc.,) of the loaded
swf.
Please help me.Yes. hashcode is not absolutely unique. I know this.
I had took this idea into my consideration. But it failed finally.
Thanks
To JN_.
Maybe I still have some misunderstood descripte my question.
neither the name not an "instance name" nor an "object name".
So now, I really do not know how to call this.
Can you tell me? Then I will not make the same fault next time.
thanks. -
How to get the Instance Name of Creator
Hi all.
I have an idea but I don't how to implement it. I have tried about two days.
the simplified concept that what I wnat is as follows
class classA {
classB objB = new classB();
class classB {
puclic void showObjName(){
//How can I the Instance Name of Creator here?
//In this Example. The name is objA.
public class showCreator {
public static void main(String[] args) {
classA objA = new classA();
I try to instanciate an Throwable Object and use the getStackTrace method.
but all information in the stack I got Do Not contain the Instances Name.
Does any one have idea to implements this...
Thanks.Yes. hashcode is not absolutely unique. I know this.
I had took this idea into my consideration. But it failed finally.
Thanks
To JN_.
Maybe I still have some misunderstood descripte my question.
neither the name not an "instance name" nor an "object name".
So now, I really do not know how to call this.
Can you tell me? Then I will not make the same fault next time.
thanks. -
Hello,
we are trying to build a list of running server processes in a SAP Java Server >= 7.10 from inside the system. At the moment we are able to retrieve the internal IDs of the active server processes with JMX. So we have a list of numeric values. These are exactly the ID numbers we can see on the system info page.
For readability purposes in our application we like to "translate" the IDs to a simpler notation form (like in the ABAP world). E.G. Server process 1 of Instance ID123456 on server abcde with system number 88 should be renamed to abcde_88_1. That way it should be easier for administrators to find directories in case of an error analysis.
We tried to use classes/methods from the SystemInfo package but we do not get any result. The best function candidate would be:
/usr/sap/SID/J00/j2ee/cluster/apps/sap.com/tc~monitoring~systeminfo/servlet_jsp/monitoring/root/WEB-INF/lib/sap.com~SystemInfo.jar
/usr/sap/SID/J00/exe/sapjvm_6/bin/javap -c SystemInfo
public com.sap.engine.monitor.infoapp.InstanceInfo[] getInstances();
Code:
0: aload_0
1: getfield #7; //Field instances:[Lcom/sap/engine/monitor/infoapp/InstanceInfo;
4: areturn
Maybe someone has a better idea of how to get the data. Any help is appreciated.
Markusyou're welcome.
FYI: a for...in loop loops through all the accesible
properties (in the broadest sense of the meaning, includes
methods/functions and variables etc). Each time it finds one it (in
this case) assigns the property name to the variable 'unknown'
the code inside the loop just checks
a) is it a property that references a movieclip instance and
b) is it the same property name as the movieclip instance's
_name property (this is to avoid listing additional references to
the same movieclip instance that may be set up as variables in your
McA's scope).
I just read that and I'm wondering if it actually will help
you understand... its quite complicated to describe,sorry...
although its simple to understand once you get used to it. To learn
you should experiment with a few for.. in loops on different
objects and see what trace outputs you get. -
I was wondering if there was any way to get the instance name
of the class to the class without having to pass it in when you
create the instance of it. For example, so I can do this:
var myObject:CustomClass = new CustomClass();
and then the class knows whats its instance name being used
is instead of having to do something like this:
var myObject:CustomClass = new
CustomClass("myObject");As I think I found out how to gnerate unique key form components passed to my method and afterwards be able to get this key by knowing the component.My code is following:
public static String generateUniqueKey(Component c){
String resultString="";
String s = c.getAccessibleContext().getAccessibleComponent().toString();
StringBuffer stringbuffer = new StringBuffer(s);
if(!Character.isJavaIdentifierStart(stringbuffer.charAt(0))){
resultString="a_";
}else{
resultString=resultString+stringbuffer.charAt(0);
for(int j = 1; j < s.length(); j++){
if(!Character.isJavaIdentifierPart(stringbuffer.charAt(j))){
resultString=resultString+"_";
}else{
if (stringbuffer.charAt(j)=='$'){
resultString=resultString+"s_";
}else{
resultString=resultString+stringbuffer.charAt(j);
return resultString;
Any suggestions on this. May this result in problems anywhere?
Thanks -
Powershell to get instance name
Hi,
Not sure whether this is the forum to ask.I have a list of servers names and i need to get the instance names in below format.
SERVERNAME\INSTANCE1
The o/p of the script actually shows Servername,MSSQL$Instance name..Anyway to tweak this to SERVERNAME\INSTANCE1?
$servers = get-content "C:\SQLCheck\machinelist.txt"
$logfile = "C:\SQLCheck\sql-instances.txt"
$logerrs = "C:\SQLCheck\sql-failures.txt"
Echo "Server, Instance" >> $logfile
ForEach ($server in $servers) {
$instances = Get-WmiObject -ComputerName $server win32_service | where {$_.name -like "MSSQL*"}
if (!$?) {
Echo "$server - No SQL instance found" >> $logerrs
Echo "$server - No SQL instance found"
Else {
ForEach ($instance in $instances) {
if (($instance.name -eq "MSSQLSERVER") -or ($instance.name -like "MSSQL$*")) {
Echo "$server\$instance.name" >> $logfile
Echo "$server, $($instance.name)"
Best Regards, Arun http://whynotsql.blogspot.com/Hi,
Use the sqlcmd -L command:
$SqlCmd = "sqlcmd -L "
Invoke-Expression $SqlCmd
sqlcmd Utility
http://technet.microsoft.com/en-us/library/ms162773.aspx
Thanks.
Tracy Cai
TechNet Community Support -
Okay, I want to be able to click anywhere and get the
instance name of any object. The kicker is this actionScript needs
to be on the main timeline and not on the movieClip. In other
words, if I have one movieClip on the stage named "my_MC". I want
to be able to run the movie and when I click on the stage it will
trace "_level10", but when I click on the first movieClip, it will
trace its instance name "my_MC".
I know that:
this.onMouseDown = function() {
trace(this);
will give me the instance name of the stage or "_level10",
but how do I make it identify the movieClip I'm clicking on without
putting any script on the movieClip itself?You need to do something like this, since the generic parameters don't exist at runtime.
public M createMInstance(Class <? extends M> clazz) {
return clazz.newInstance();
}I'm not very well versed in generics, so you may have to tweak it a bit, but the main idea is that you have to provide the Class object. -
Tween and getting instance names problems
Hi, iv got these buttons animated using the inbuilt tween
function and am coding them like this:
function navOver(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
var myTween16:Tween = new Tween(page, "y", Regular.easeOut,
0, -25, 0.35, true);
function navOut(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
var myTween17:Tween = new Tween(page, "y", Regular.easeOut,
-25, 0, 0.35, true);
function navClick(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
page.y = 0;
button.addEventListener(MouseEvent.ROLL_OVER, navOver);
button.addEventListener(MouseEvent.ROLL_OUT, navOut);
button.addEventListener(MouseEvent.MOUSE_DOWN, navClick);
but if i click on the button before the animation has
finished it ignores the
page.y = 0; code and does nothing. how can i fix this?
also im trying to get the instance name of a mc called
"home" using this code:
MovieClip(e.currentTarget) wich gives me the result
[object button_1]
and
MovieClip(e.currentTarget).instanceName returns
undefined
neather of which are the instance name.
i cant hardcode the function because its used on lots of
different mcs throughtout the flash file
thanksif you want to send the 'page' back to the 0 position, you
might be better off declaring the tweens outside the method, in
this way you can control them in 'other' methods that aren't local
to where the assignment is made, for instance:
var myTween17:Tween;
then in the handler navOut, just 'assign' the tween:
myTween17 = new Tween( .. );
then in the navClick method you could call:
myTween17.stop();
myTween17.rewind();
and that should reset the clips position to 0
for your other question use:
MovieClip(e.currentTarget.name); -
How to obtain instance name of Movie Clip?
Hello!
Is there a way to get the instance name of a move clip once it's on the stage? In my dress up game, I need to know which items are on the doll in order to keep them visible. My drag and drop feature uses an array and currentTarget:
var dragArray:Array = [Doll.Drawers.Dress1, Doll.Drawers.Dress2, Doll.Drawers.Dress3, Doll.Drawers.Dress4];
for(var i:int = 0; i < dragArray.length; i++)
dragArray[i].buttonMode = true;
dragArray[i].addEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
dragArray[i].addEventListener(MouseEvent.MOUSE_UP, item_onMouseUp);
function item_onMouseDown(event:MouseEvent):void
var clip:MovieClip = MovieClip(event.currentTarget);
clip.startDrag();
function item_onMouseUp(event:MouseEvent):void
var clip:MovieClip = MovieClip(event.currentTarget);
clip.stopDrag();
if(clip.hitTestObject(Doll.Skins))
//Here's where the problem starts! ---------------------------------------------- //
trace("It's on the doll!");
It can successfully run this code. However, instead of tracing "It's on the doll!", I'd like to turn the currentTarget into it's instance name, which should be "Doll.Drawers.Dress1" etc... and then store that name in an array.
How would I do this?
I've looked into e.target.name, but I keep getting errors...use the name property of clip (if that's the movieclip whose name you want):
var dragArray:Array = [Doll.Drawers.Dress1, Doll.Drawers.Dress2, Doll.Drawers.Dress3, Doll.Drawers.Dress4];
for(var i:int = 0; i < dragArray.length; i++)
dragArray[i].buttonMode = true;
dragArray[i].addEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
dragArray[i].addEventListener(MouseEvent.MOUSE_UP, item_onMouseUp);
function item_onMouseDown(event:MouseEvent):void
var clip:MovieClip = MovieClip(event.currentTarget);
clip.startDrag();
function item_onMouseUp(event:MouseEvent):void
var clip:MovieClip = MovieClip(event.currentTarget);
clip.stopDrag();
if(clip.hitTestObject(Doll.Skins))
//Here's where the problem starts! ---------------------------------------------- //
trace(clip.name); // but that won't be Doll.Drawers.Dress1. it might be Dress1.
Maybe you are looking for
-
BOM business requirement for sales order and PGI
Hi Experts, Current setting The BOM structure is A = A1+A2 1) Material A created in MM master item category group = ERLA 2) Sub component material A1 and material A2, MM master item category group = NORM for both component. 3) Maintained in CS01 BOM
-
Firmware upgrade in place?
I updated my G5 to Panther, 10.3.9, and I have downloaded the firmware upgrade for my early 2004 G5(the DDR RAM G5, not the DDR2). Now when I go to update, I press the shut down button and it shuts down. Fine. Then I press the start button, and wait
-
Check Deposit : Date Issue
In FF68 Transaction Header screen there are Entry Date Posting Date Value Date On the detail transaction screen inside i.e. chequewise detail entry screen also we got Doc Date Posting Date Value date but by default system takes header values for all
-
IPhone doesn't recognize some keys
I bought a 3G (not 3GS) iPhone a couple of weeks ago. After a few days, it stopped recognizing the O and 9 keys on vertical (portrait) keyboards. That problem went away after a couple of days. Now, about a week later, the probelm has returned. Apple
-
Reseting the Hashed Password after enabling Windows File Sharing
Disclaimer: you'll need a good bit of knowledge about OS X, UNIX, and encryption to understand what I'm talking about. All right, so normally OS X hashes user passwords using a salted SHA1 encryption. It uses shadowing so that you can't obtain the ac