Java Equivalent

Is there any Java equivalent of .net's DataAdapter.Thanks

I would look into either Hibernate or the java persistency API if I were you. There is no direct substitute for DataAdapter, but those API's may be able to do what you want.

Similar Messages

  • Java equivalent with expression?

    noob here.
    is there a java equivalent of the vb with expression?
    with someObect
    .propery = someValue
    .method
    End with

    Don't know VB, but at 1st appearance it kind of looks like:
    someObject.property = someValue;
    someObject.method();

  • Javas equivalent of C .h files

    What would the the Java equivalent of .h files for C be?
    I'm just looking for a name/tag so I can look it up.

    Yeah it is not clear, OP, if you mean to enforceor
    merely inform.Just to inform.You do know what javadoc is? Here's the javadoc for JSE 6:
    http://java.sun.com/javase/6/docs/api/index.html
    It's generated from source code.

  • Implement the Java equivalent of onMouseOver JavaScript function

    I am translating a web app written in JavaScript into Java applet. I am adding Line and Rectangle objects to the applets. How can I implement the Javascript equivalent of onMouseOver and onMouseOut functions to the objects in the applet?

    Heres an example. The lines dont work though.
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.ArrayList;
    public class RolloverTest{
    public static void main(String[] args){
         new RolloverTest();
    public RolloverTest(){
         shapes = new ArrayList(5);
         Rectangle rect1 = new Rectangle(10, 10, 40, 40);
         shapes.add(new HotShape(rect1, mouseOff));
         Rectangle rect2 = new Rectangle(40, 70, 40, 40);
         shapes.add(new HotShape(rect2, mouseOff));
         Line2D line1 = new Line2D.Double(100, 100, 200, 200);
         shapes.add(new HotShape(line1, mouseOff));
         Line2D line2 = new Line2D.Double(10, 300, 300, 10);
         shapes.add(new HotShape(line2, mouseOff));
         Ellipse2D oval1 = new Ellipse2D.Double(300, 100, 60, 60);
         shapes.add(new HotShape(oval1, mouseOff));
         hotPiece = (HotShape)shapes.get(0);
         drawingBoard = new DrawingBoard(this);
         frame = new JFrame("Rollover Test");
         frame.setContentPane(drawingBoard);
         frame.setSize(500, 500);
         frame.setLocationRelativeTo(null);
         frame.setVisible(true);
    public class DrawingBoard extends JPanel implements MouseMotionListener{
    public DrawingBoard(RolloverTest rt){
         this.rt = rt;
         this.setBackground(Color.WHITE);
         this.addMouseMotionListener(this);
    public void paintComponent(Graphics g){
         super.paintComponent(g);
         Graphics2D gfx = (Graphics2D)g;
         gfx.setStroke(new BasicStroke(5));
         for(int i = 0; i < rt.shapes.size(); i++){
         HotShape shape = (HotShape)rt.shapes.get(i);
         gfx.setColor(shape.color);
         gfx.draw(shape.shape);
    public void mouseDragged(MouseEvent evt){}
    public void mouseMoved(MouseEvent evt){
         for(int i = 0; i < rt.shapes.size(); i++){
         HotShape shape = (HotShape)rt.shapes.get(i);
         if(shape.shape.contains((double)evt.getX(), (double)evt.getY())){
         rt.hotPiece.color = rt.mouseOff;
         rt.hotPiece = shape;
         shape.color = rt.mouseOn;
         this.repaint();
         RolloverTest rt;
    public class HotShape{
    public HotShape(Shape shape, Color color){
         this.shape = shape;
         this.color = color;
         Shape shape;
         Color color;
         JFrame frame;
         DrawingBoard drawingBoard;
         ArrayList shapes;
         HotShape hotPiece;
         Color mouseOff = Color.BLUE;
         Color mouseOn = Color.RED;
    }Message was edited by:
    TuringPest
    Even using a bigger Stroke the lines wont return true for contains(). So you will have to find a different approach for lines.

  • What is the java equivalent to #define

    Hi,
    What would this declaration be in java:
    #define     STRAIGHT_FLUSH     1
    Many thanks, Ron

    There is no direct equivalent. As mentioned, enums can be used to fill one of #define's roles. (enumerated values)
    public static final constant member variables can fulfill another. (named constants)
    And actually, if I understand correctly, #define is not part of the C language per se, but belongs in the realm of the preprocessor, and you can run Java code through a c preprocessor.
    EDIT: Yeah, you can:
    :; cat X.java
    #define blah int
    public class X {
      Y y;
      blah x;
    jeff@shiro:/tmp 14:33:34
    :; cpp -P !$
    cpp -P X.java
    public class X {
      Y y;
      int x;
    }Message was edited by:
    jverd

  • Java Equivalent to Get ForegroundWindow?

    MSWindows native programming has a call named GetForegroundWindow(). This call returns the handle to an application window that currenlty is active (sometimes also termed as "has focus"). I'm looking for something equivalent in Java.
    Note that any method that gets the name of the application (such as MSWord), and the file that is being processed (such as Document1.doc) will do.
    It would also be nice to find a method of being notified by MSWindows when the foreground window changes.
    And, finally, having this workable in both Linux and MSWindows would be great - even if the methods are different for the two operating systems.

    Note that any method that gets the name of the
    application (such as MSWord), and the file that is
    being processed (such as Document1.doc) will do.Did you notice the word "native" you used earlier? Java wouldn't know about other processes and their windows, and most certainly not in a system-independant way.

  • Java Equivalent Function to Obfuscation DES3 Procedures

    I've read all of the notes and reports that I could find on both OTN and MetaLink, but I can't find a solution anywhere. Just hints, particularly in Note 232000.1 and Note 225214.1. I've been trying all of the variations that I can think of in test code with no success. I've also searched the net extensively.
    What I need is a code sample IN JAVA that provides equivalent functionality to the des3encrypt and des3decrypt procedures using raw values in the obfuscation toolkit.
    We have a number of huge databases in which we would like to use the obfuscation toolkit with DES3 3-key (192-bit) keys to manage encrypting
    confidential data. We need to be able to read this data from Java applications. Those applications must be able to decrypt the values encrypted using the toolkit. We must also be able to do the reverse, encrypt data in Java, store the encrypted values, the decrypt and access the data in PL/SQL using the toolkit.
    I've searched high and low, but I cannot find sample code anywhere for performing this functionality in an equivalent fashion.
    Thanks!
    Mark Scarton
    [email protected]

    Hi Mark,
    I encountered a similar challenge, were you able to figure out the solution for this problem?
    Thanks,
    Srikanth

  • Java equivalent to VBScript functions/operators

    I need to re-write some VBScript code to j2me code. I'd like to know if there is an equivalent to the following VBScript functions in j2me.
    Function Chr(): The Chr function converts an ANSI character code value to a character. I think I can just use char x = (char) myCharValue. correct?
    Function Asc(): The Asc function returns the ANSI character code value for the first character in a string.
    Operator Xor: The Xor operator can be used a "bitwise operator" to make a bit-by-bit comparison of two integers. If both bits are the same in the comparison (both are 0's or 1's), then a 0 is returned. Otherwise, a 1 is returned. For example: Xor performs a bitwise comparison on the 3 (in binary 011) and the 5 (in binary 101), and returns a 6 (in binary 110).

    Function Chr(): The Chr function converts an
    ANSI character code value to a character. I think I
    can just use char x = (char) myCharValue. correct?Yes
    Function Asc(): The Asc function returns the
    ANSI character code value for the first character in
    a string.
    String abc = "ABC";
    char firstchar = abc.charAt(0);
    Operator Xor: The Xor operator can be used a
    "bitwise operator" to make a bit-by-bit comparison of
    two integers. If both bits are the same in the
    comparison (both are 0's or 1's), then a 0 is
    returned. Otherwise, a 1 is returned. For example:
    Xor performs a bitwise comparison on the 3 (in binary
    011) and the 5 (in binary 101), and returns a 6 (in
    binary 110).A simple google search will give you that "^" is an xor.

  • What is the Java equivalent to Windows SystemMetrics?

    Hello,
    I would like to retrieve component metrics on items such as titlebar height, horizontal scrollbar height, default font etc.
    Unfortunately, I want to know the information without neccessarily having an instance of the control type visible (ie I want to know how high my forms titlebar will be before I create the form).
    The reason I need this is to feed information back to a third party product that requires the type of details that you could query from the SystemMetrics available in Windows.
    The tricky part is that the windows app needs to know these details before the Java app has created its first form.
    Any help would be much appreciated,
    thankyou, Sean.

    thankyou camickr,
    that link was very useful - please have the dukes.
    one thing that the link code doesn't give details about is how to find the metrics on the top level containers. Do you have any suggestions?

  • What is the Java equivalent of Visual BAsic ASC() and MID() functions

    Hello all! I just would like to ask if you have any idea on how to convert the VB ASC() and MID() functions into java. Where:
    1. ASC( ) Function - Returns the ANSI value for the leftmost character in a character expression.
    2. MID() Function - The Mid method extracts a substring of length nCount characters from a CHString string, starting at position nFirst (zero-based). The method returns a copy of the extracted substring.
    I would really appreciate your help. Thanx!

    ah yeah! sorry typo error. see, I am converting a VB method that encrypts password:
    Function EncryptText(ByVal stDecryptedText As String)
    Dim stText As String, lngCounter As Long
    Dim iTemp As Integer, lngNumber As Long
    lngCounter = 1
    lngNumber = 8
    Do Until lngCounter = Len(stDecryptedText) + 1
    iTemp = Asc(Mid(stDecryptedText, lngCounter, 1))
    If lngCounter Mod 2 = 0 Then
    iTemp = iTemp - lngNumber
    Else
    iTemp = iTemp + lngNumber
    End If
    iTemp = iTemp Xor (10 - lngNumber)
    stText = stText & Chr$(iTemp)
    lngCounter = lngCounter + 1
    Loop
    EncryptText = stText
    End Function
    I converted this function into this:
    public static String encryptPass(String password) {
    String encpwd = "";
    int iTemp = 0;
    final int lngNumber = 8;
    String stText = "";
    for ( int i = 0; i < password.length() ; i++ ) {
         iTemp = Character.getNumericValue(password.charAt(i));
         if ( i % 2 == 0 ) {
         iTemp = iTemp - lngNumber;
         } else {
         iTemp = iTemp + lngNumber;
         iTemp = iTemp ^ (10 - lngNumber);
         char c = Character.forDigit(iTemp,Character.MAX_RADIX);
         encpwd = encpwd + String.valueOf(c);
         return encpwd;
    But I'm having trouble with the encryption because it returns a different set of characters. Did I convert it right? thanx.

  • Can you do the Java equivalent of this with Generics?

    hi,
    http://www.informit.com/content/index.asp?product_id=%7B4BCD9193-97E4-4004-AF84-D7346E261C69%7D
    thanks,
    asjf

    Think of specialization as "compile-time" polymorphism. It allows you to create different implementations of methods/classes for different types, selected at compile-time. For example, I use template specialization extensively in Jace to unify entire sets of type-disparate JNI functions.
    Specialization is a very powerful technique and is also used extensively in template meta-programming (which brings us back to the OP). Even were the current form of Java generics to somehow magically support some form of specialization, you still wouldn't be able to perform meta-programming as Java generics don't work with constants.
    Any surface similarities between Java generics and C++ templates expire at trivial inspection, which means that it's a fairly futile exercise to try to compare the two.
    God bless,
    -Toby Reyelts
    Check out the free, open-source, JNI toolkit - Jace, http://jace.reyelts.com/jace

  • What's the Java equivalent of a .dll file?

    If any?

    Actually, DLL for Windows. Where as in java,
    It's doesn't dynamically link.
    It's some what like Reflection classes.

  • What is the Java equivalent to sapcpe

    After upgrading to ECC6 EHP5 I find none of my dialog servers have the updated jar files or bootstrap.properties file in the j2ee\cluster\bootstrap folder.
    How do jar files get copied from from server to another

    Hi,
    Please refer this link for more information on how sapcpe works.
    http://help.sap.com/saphelp_nwpi711/helpdata/en/27/44f17a26a74a8abfd202c4f5dc9a0f/content.htm
    Also refer this link
    http://al-infotech.com/news/2006/12/30/use-sapcpe-for-kernel-update-on-netweaver-2004-as-java-by-yu-nong-zhang-sap/
    I hope this clarifies.
    Regards,
    Naveen.

  • Java equivalent to OLE Compound file

    Back in my C++ days we used Microsoft's compound files so we could write several independent streams to a file at the same time. This helped with saving/loading because we could write a bit to the end of one stream, then a bit to the other...and it all ended up in one file. (kind of like an entire directory system in one file)
    Does anyone know of anything similar in Java? I can imagine that it would be hard to write a library like that and keep it platform independent. I'm thinking I may need to write to a directory structure, and then zip it up or something (anyone know how to zip stuff from within java code?)
    thanks in advance for any pointers
    - Sandra

    use the java.util.zip package.

  • What's the proper java equivalent for unsigned4, signed8?

    I have a C++ program that uses the types "unsigned4" and "signed8" and I need to put those values into Java. What are the proper types to use in Java and what conversion methods should I use?

    It depends on what you are doing with it.
    If you are just using the values in C code and passing it in java then you can use int and long respectively. Even though an int is signed and only 4 bytes bits are still bits so it won't matter.
    If you want to use it in java then you will need to use long for both.

Maybe you are looking for

  • Stop Message while saving Service Order from IW51

    Hello, I am getting bleow error while saving service order. System: Status object does not exist. Message Numner IW351 Actually I have done one enhcement in the User exit of the Sales order in the form Routine... USEREXIT_SAVE_DOCUMENT_PREPARE From t

  • Errors:Installing Oracle Portal, Forms, Reports and Discoverer on Win7

    Someone can help me? I installed Oracle Portal, Forms, Reports and Discoverer on Win7. I have install: jdk 64bit Oracle db 11g (64bit) Oracle Weblogic 1033 (wls1033_generic.jar) Oracle Portal, Forms, Reports and Discoverer (ofm_pfrd_win_11.1.1.2.0_64

  • Latency compensation doesn't work on I/O plugin?

    So, I thought this was supposed to work... I tried to set up some parallel compression by sending my drum bus to another Aux which had the I/O plug inserted. The I/O plug sent the drum signals to my hardware compressor (and back). But the problem is,

  • Create file on javacard

    Hi I want to store a picture on my javacard. Is there a way to do it ? I think it will be easy if i put the byte[] on a file but i don t know if it s possible to creat a file in a javacard ? could i have some help please ? thanks

  • I can't get the Google Search App to work.

    My Google Search App was working fine on my iPad mini. Then I installed Chrome and didn't synch it right off the bat. Chrome works fine but now Google Search App won't let me log in or work. I've tried deleting it/reinstalling it and rebooting my iPa