Oraub8 (64-bit int) and Number class
What's the best mechanism for getting and setting numbers from a 64-bit integer (oraub8). I'm surprised these methods don't exist the Statement or ResultSet classes by now.
Strategies I'm considering: A) use getNumber().getBytes() and then do the conversion, or B) use setDataBuffer() to get the raw number format directly and then do the conversion.
That's my whole point. The OCCI Number class doesn't have an operator int64() method. Nor do Statement or ResultSet have getXXX()/setXXX() methods for 64-bit integers. Compilers have supported 64-bit ints for a while now.
Sequences used as primary key generators can certainly be larger than a 32-bit integer. I don't have a primary key that large...yet. But I could being there within the next year or two. I'm looking for a migration path for my code. Continuing to represent a primary key as a whole number within the app is cleaner than converting from int to string.
Similar Messages
-
Difference between int and byte
what is the main difference between int and byte?
A byte is the format data is stored in memory in past. 8 bits.
An int is a format likewise you get it as value from the accumulator. For X64 that is Int64.
For compatibility the "Integer" is kept currently on Int32, the register format from the X86 computers.
Older computers likewise the 8088 had an 8 bit Int and therefore that was the same as the byte.
The 80286 had a 16 bits Integer.
Success
Cor -
Oracle.jbo.domain.Number to int and back
I have a database field that comes back as a oracle.jbo.domain.Number.
I want to increment this by one so was trying to convert it to an int, apply the increment then turn it back into a number.
2 questions :
1) Can I increment oracle.jbo.domain.Number directly
2) If not how to I turn it to an int and back
Many thanks,
RichardConvert oracle.jbo.domain.Number to int with the intValue method.
oracle.jbo.domain.Number var;
int intValue=var.intValue();Convert int to oracle.jbo.domain.Number with the Number (int value) constructor.
int intValue;
oracle.jbo.domain.Number var=new oracle.jbo.domain.Number(intValue); -
Create material serial number and update class type and class
Hi ,
do we have any function to create material serial number and update class type, class and Characteristic Description?
for transcation IQ04 0-Create material Serial number and IQ02 for change mat. serial number
cheers,
RAAGhi
u can go to iqo2 and click class overview and assign the class type ,class and description.but u need to maintain class for this first.
it would be helpful for u to read iut 221 for work management
for creation of class,service object etc.and understand the concept .
all the best
kr
raj
RAJ on Oct 14, 2008 3:20 PM -
Addition in Java bits, bytes and shift
Hi,
I have a byte array consisting of 8 bit values in each cell.
When I do an addition of two cells - which gives me a 16 bit result I use the following:
Integer a = (int) (arr[value] & 0xff);
a = a << 8;
Integer b = (int) (arr[secondValue] & 0xff);
Integer c = a + b;This seems to work fine. My question is how would I add 3 (24 bit result) or 4 (32 bit result) cells.
Would the following work: 24 bit result
Integer a = (int) (arr[value] & 0xff);
a = a << 16;
Integer b = (int) (arr[secondValue] & 0xff);
Integer c = (int) (arr[thirdValue] & 0xff);
Integer d = a + b + c;I am not sure if I have got the shift (<<16) usage correct or if it should be used in order to obtain the variables b or c.
All help appreciated.khublaikhan wrote:
Just to confirm for 32 bit it would be:
// 32-bit
int a = (int)(arr[value] & 0xff);
int b = (int)(arr[secondValue] & 0xff);
int c = (int)(arr[thirdValue] & 0xff);
int d = (int)(arr[fourthValue] & 0xff);
int e = (a<<24) + (b<<16) + (c<<8) + d;
Integer eInt = new Integer(e);
Actually, the more I think about it, you may need to use longs instead of ints for 32-bit (not 16- or 24-bit though). It depends on what your data actually is. If you're expecting your 32-bit number to be an unsigned integer, then you'd better go with long. This is because in Java, ints utilize two's complement, so if the high-order byte you read in for a 32-bit value is very large, the resulting int will be interpreted by Java as a negative number instead of the large positive value you expect.
I'm probably not being very clear. Check out http://en.wikipedia.org/wiki/Two's_complement for the details.
In other words, if you wanted to get 32-bit values in this way, and the computed values are expected to be non-negative integers, use this:
// 32-bit
int a = (int)(arr[value] & 0xff);
int b = (int)(arr[secondValue] & 0xff);
int c = (int)(arr[thirdValue] & 0xff);
int d = (int)(arr[fourthValue] & 0xff);
long e = (a<<24) + (b<<16) + (c<<8) + d;
Long l = new Long(e);If you're actually reading in a 32-bit, two's complement value, then keep using int like you originally posted. -
How can if find the most repeated character and number ???
Hi,
I have a question. For instance, if we have a text file which contains:
aaabbbhhhhhhtttttsjs12366
How can i find the most repeated character and number. I have to add this code to the following program:
I will aprreciate if you can help.
Regards,
Serkan
import java.io.*;
public class LineLen {
public static void main(String args[]) throws Throwable {
final String filename = "deneme1.txt";
BufferedReader infile = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
String line = infile.readLine();
int linenum = 0;
while (line != null) {
int len = line.length();
linenum++;
System.out.print(linenum + "\t");
for (int i = 0; i<len; i++)
System.out.print("*");
System.out.println("");
line = infile.readLine();
}For a small alphabet like English, array migt be used:
//in a for loop
++array[s.charAt(i)];For a big alphabet like chinese, HashMap might be barely used:
map.put(s.charAt(i), increment(map.get(s.charAt(i))));
// increment is a user defined method, possibly for an Integer object,
// that returns a new Integer object -
Inheritance and extending classes - homework
Here ive got a problem, firstly i don't know why this code won't work, ive got to use the keywords abstract + extend.
Ive put this all into one .java file, when should I put a class into a different file and not place it as an inner like i have done a number of times here ?
public abstract class shape {
int pi;
int radius;
public class twoD extends shape {
twoD(int r, int p) { //constructor for circle
radius = r;
pi = p;
public void setAreaCircle() { // area of circle method
int circleArea = pi * radius^radius;
System.out.println(circleArea);
public void setCircumCircle() { // circumfreanceof circle method
int circleCircum = 2 * pi^radius;
System.out.println(circleCircum);
class circle extends twoD {
public static void main(String args[]){
twoD ob = new twoD(5,10);
ob.setAreaCircle();
ob.setCircumCircle();K ive done as suggested and added a constructor that calls its superclass contrustor but its still not working. :(
Any clues ?
public abstract class shape {
int pi;
int radius;
class twoD extends shape {
twoD(int r, int p) { //constructor for circle
radius = r;
pi = p;
public void setAreaCircle() { // area of circle method
int circleArea = pi * radius^radius;
System.out.println(circleArea);
public void setCircumCircle() { // circumfreanceof circle method
int circleCircum = 2 * pi^radius;
System.out.println(circleCircum);
public class circle extends twoD {
public static void main(String args[]) {
public circle(int r, int p) { // call to superclass constructor
super(r,p);
twoD ob = new twoD(5,10);
ob.setAreaCircle();
ob.setCircumCircle(); -
Full error message:
An Integration Services class cannot be found. Make sure that Integration Services is correctly installed on the computer that is running the application. Also, make sure that the 64-bit version of Integration Services is installed if you are running a 64-bit
application
I have developed SSIS package in my development machine where the OS is 64 bit and sql server 2012 is installed.
The package has excel source and oledb destination. Excel files can be both .xls and .xlsx format. Since i want to run both xls and xlsx format i have installed
32 bit Microsoft Acess database engine form the below link, then both xls and xlsx format worked.
.xls - 32 bit
.xlsx - 32 bit and 64 bit is available. So in common i have to run it in 32 bit.
I have set Run64BitRuntime to False and ran package. it is working fine. I cannot set Run64BitRuntime to True and run the packages. Because i have office products installed on my machine which is 32 bit. if try to install 64 bit Microsoft Acess
database engine redistributable pacakage from below link , it is throwing error saying that, already office 32 bit product is installed so uninstall 32 bit product and install 64 bit.
Excel connection string is Ace database engine only. everything works fine.
microsoftcom/en-us/download/details.aspx?id=13255
Now i am trying to invoke package from c# code by using Microsoft.SqlServer.ManagedDTS.dll and it is also working fine in my dev machine.
When i deploy the web application in production am getting the error while invoking package. the full error message is posted in 1st line of this thread.
Then i tried to execute the package in production server by using dtexec utility, it is working fine. I tried both 32 bit and 64 bit dtexec utility by going to specific path (program files(x86) and Program files) via command prompt.
It is all working fine. So the error coming when i invoke from web application. My guess is ManagedDTS causing problem.
Where can i find 64 bit Microsoft.SqlServer.ManagedDTS.dll
or is it because of any other problem. i have checked below links, still problem not resolved.
social.msdn.microsoftcom/Forums/sqlserver/en-US/491384d2-02f7-4178-a1c3-bcbd58e57fce/an-integration-services-class-cannot-be-found-make-sure-that-integration-services-is-correctly?forum=sqlintegrationservices
forums.aspnet/t/1990417.aspx?Issue+deploying+SSIS+Package+in+production+web+server1) "I have set Run64BitRuntime to False and ran package" -> this is not valid outside of your development environment, it is made for simulation purposes as all the dev tools are 32 Bit
2) "Where can i find 64 bit Microsoft.SqlServer.ManagedDTS.dll " is basically SSIS. It is quite possibly the culprit. I am inclined to think you attempt to run the package where there no SSIS installed.
Arthur
MyBlog
Twitter -
I am getting an error message when initializing iTunes.
iTunes was not properly installed. If you wish to import or burn CD's
you need to reinstall iTunes.
I uninstalled, cleaned the reg, and reloaded a few times.
Diagnostic DVD/CD test results "Upper Filter Status Failed" (no CD Rom Driver found)
All seems to be working ok otherwise and CD's seem to be importing OK
Bud
Message was edited by: idraliviTunes doesn't officially support 64 bit Windows and the 64 bit Gear drivers you need for burning arn't supplied. You can download them from here:
http://www.gearsoftware.com/support/drivers.cfm
A number of people also had problems with the creation of the CD configuration folder, but as your iTunes is working, I guess that doesn't apply to you. -
In windows 8.1 64 bit , brightness and sleepmode not working
I have the 15-g009AX notebook via flipkart . After installation of windows 8.1 64 bit brightness and sleepmode and hybernate mode not working
Please send the solution.
From.,
MadhuHello @vmsbobj ,
Welcome to the HP Forums!
I understand after installing Windows 8.1 you are no longer able to use the brightness, hibernate or sleep mode options.
I cannot seem to find the exact model you've listed. The drivers found here should do the trick for you though: HP 15-g030au Notebook PC Drivers. What you're looking for is the HP System Event Utility software found in the Software - Solutions section.
If you can respond with the product number for the notebook I may be able to give a better answer. For information on finding your product and model numbers click here: How Do I Find My Model Number or Product Number?
Let me know if this utility resolves the issue.
Please click the "Kudos, Thumbs Up" at the bottom of this post if you want to say "Thanks" for helping!
Please click "Accept as Solution" if you feel my post solved your issue, it will help others find the solution.
The Great Deku Tree
I work on behalf of HP. -
I own CS6. I just built a new computer with Win-7. How do I change to the 64 bit version and install on the new computer?
Lancedownload the installation file(s) and activate with your serial number,
Downloads available:
Suites and Programs: CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
Acrobat: XI, X | 9,8 | 9 standard
Premiere Elements: 12 | 11, 10 | 9, 8, 7
Photoshop Elements: 12 | 11, 10 | 9,8,7
Lightroom: 5 | 4 | 3
Captivate: 8 | 7 | 6 | 5
Contribute: CS5 | CS4, CS3
Download and installation help for Adobe links
Download and installation help for Prodesigntools links are listed on most linked pages. They are critical; especially steps 1, 2 and 3. If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.
window using the Lightroom 3 link to see those 'Important Instructions'.< -
I am receiving the error code (-50) when trying to access the itunes store. The original itune songs etc were installed on a win 7 32 bit system and I have now moved to a win 7 64 bit system (same PC) and have copied the folder across. Has the switch from 32 to 64 bit caused the problem? Is this why I get the error code? I can, however, access the itunes store to view my account. Any ideas please?
Hello,
The TechNet Sandbox forum is designed for users to try out the new forums functionality. Please be respectful of others, and do not expect replies to questions asked here.
As it's off-topic here, I am moving the question to the
Where is the forum for... forum.
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book: Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C40686F746D61696C2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}}) -
Hello,
Can anyone tell me what the benefits of anonymous and inner classes are? inner classes are seem pretty complicated without any obvious benefit.
I have read about these in books and have some understanding of them but these don't appear to have any benefits.
Any info on either would be really cool.
regardsThere are many places where inner classes can be useful. One place where anonymous inner classes are particularly neat is for ActionListeners. For example, compare the "normal" way of doing it:
for(int i = 0; i < 2; i++)
JButton button = new JButton("Button " + i);
button.setActionCommand("ACTION" + i);
button.addActionListener(this);
public void actionPerformed(ActionEvent e)
if("ACTION0".equals(e.getActionCommand()))
doSomething(0);
else if("ACTION1".equals(e.getActionCommand()))
doSomething(1);
}with the way using anonymous inner classes:
for(int i = 0; i < 2; i++)
final int index = i;
JButton button = new JButton("Button " + index);
button.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
doSomething(index);
.In the first case you need a global actionPerformed method with some if statements inside. If there are many types of action then this can quickly become very large and error-prone. In the second case, each action is handled in its own class, right with the button that it's associated with. This is easier to maintain. Note that local variables must be declared final to be accessible from the inner class. -
Working with traits and policy classes
I have not been able to see if anyone has raised this before from my searches of the forums but this may just be bad searching !
I am trying to investigate how much of the traits / policies idioms of working in C++ generic programming are applicable to Java. The following trio of classes are a very striped down version of one problem I am having. It relates to the use of static methods, inheritance and generic classes.
First a couple of classes with static methods related by inheritance.
public class X {
public static int get() {
System.err.println("X.get.") ;
return 1 ;
public class Y extends X {
public static int get() {
System.err.println("Y.get.") ;
return X.get() + 1 ;
}Now a class that uses the types as type parameters and tries to call the static method:
public class TypeParameterLookupSolved<A extends X> {
private void doit() {
System.out.println(A.get()) ;
public static void main(final String[] args) {
TypeParameterLookupSolved<Y> tpli = new TypeParameterLookupSolved<Y> () ;
tpli.doit() ;
}The output from running this is:
X.get.
1
So the question is why does the call of A.get() always bind to X.get() when na�vely you would expect Y.get() to be called.
If Java will only ever call X.get() in this instance then the policy class idiom will not work properly . Of course it may be that there is another way of doing this that I have missed.
Thanks.Thanks for the correction.
I never can get the hang of up and down in type hierarchies -- functional programming people talk a lot about top and bottom in type hierarchies and I never remember which is which. One of these days I will find a mechanism for putting the knowledge into long-term memory :-)
Having had the epiphany of "least upper bounds", it is now trivially easy to do Java-style generic programming (which is good :-) even though it is totally different to everyone else (C++, Python, Groovy, Ruby, Nice, CL, OCAML, Haskell, . . .-- which is not so good). I am increasingly of the view that using the term Generics has been a labelling error and an unfortunate disservice to Java as it can set up a mind-set about parameterized types and "generic programming" that is fundamentally wrong. I can feel a series of short articles coming on as well as sorting out my ADS library! -
Hello,
I am interested in the following situation. I have 2 database tables and corresponding DTO and DAO classes. Here are the DTO classes:
public class DTO1 {
private int column1;
private String column2;
private String column3;
private int fk1;
/* getters, setters*/
public class DTO2 {
private int id;
private String name1;
private String columnX;
private String columnY;
/* getters, setters*/
}Suppose that we want to execute the following query:
SELECTt1.column1, t1.column2, t1.column3, t2.name FROMDTO1 t1, DTO2 t2 WHERE t1.fk1 = t2.id;What's right to do?
Should I extend DTO1 class and add another field, e.g.
public class DTO1Extended extends DTO1{
private String name;
/* getters, setters*/
}and then use this extended model together with base model in my DAO class?
Or, should I add this name field in my base model class, e.g.:
public class DTO1 {
private int column1;
private String column2;
private String column3;
private int fk1;
private String name;
/* getters, setters*/
}I think that the first approach is more OO.
Or, maybe, there is some other (better) solution?
What would some persistence framework, like Hibernate, done to resolve this situation?Already answered in the other thread which you hijacked: [http://forums.sun.com/thread.jspa?threadID=5360009].
Maybe you are looking for
-
I am a group exercise instructor and rely heavily on my playlists. My old phone is an iphone 4s and I just bought an Iphone 6. I also have a macbook where I keep my itunes account, but I create all my playlists on my phone. I need to transfer thos
-
Trying to make sense of AS2 gradient fill matrices
This one will likely interest kglad, but I'm all ears for insight from anyone who digs math. I've been working with gradient fills lately in AS2, which means I've been reading through related entries in the ActionScript 2.0 Language Reference. Here's
-
How do I connect iCloud mail to outlook 2007
I have followed the directions on the website for setting up outlook 2007 to retrieve and send mail through my iCloud account. I continually receive an error message that outlook cannot connect to the imap server. How do I fix this?
-
I have blackberry bold 9000 but I don't have internet from my provide. Now I have a simple question , why I can't login to my MSN on my blackberry via the WIFI ? I Keep receive this message service not enabled for the handheld, although I can use th
-
Satellite L450-136 Model video transfer from camcoder to laptop
Hi , I have recently bought Toshiba Satellite L450-136 Model laptop. I want to transfer the video contents from my SONY Camcoder to the Laptop. The SONY Camcoder has a 4 pin slot . In this model laptops I believe their isn't any 4 pin slot. Can you p