In Java,how can I get remote oracle server's system time using a XAOracle datasource

I want to get remote oracle server's system time,for example,I use a TxDataSource:
DRIVER className:weblogic.jdbc.oci.xa.XADataSource
URL:jdbc:weblogic:oracle:lanhaibo
JNDI Name:
the following is the code which shows the exception that: sqlexception:the JDBC2.0
method is not implemented,why? what should I do?:
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL,"t3://"+"localhost"+":" + "7001");
initCtx = new InitialContext(prop);
DataSource ds = (DataSource)initCtx.lookup(strDataSource);
Connection conn = ds.getConnection();
String sqlQuery = "select to_char(sysdate,'yyyy') YYYY,to_char(sysdate, 'MM')
MM,to_char(sysdate, '" +
"dd') DD,to_char(sysdate, 'hh24') HH,to_char(sysdate, 'mi') MI,to_char(sysdate,
'" +
"ss') SS from dual"
preparedStatement pstmt = conn.prepareStatement(sqlQury);
StringBuffer sb = new StringBuffer();
ResultSet resultset = pstmt.executeQuery();
if(rs.next()){
strYear = rs.getString("yyyy");
strMonth = rs.getString("MM");
strDay = rs.getString("DD");
strHour = rs.getString("HH");
strMinute = rs.getString("MI");
strSecond = rs.getString("SS");
sb.append(strYear);
sb.append("/");
sb.append(strMonth);
sb.append("/");
sb.append(strDay);
sb.append(" ");
sb.append(strHour);
sb.append(":");
sb.append(strMinute);
sb.append(":");
sb.append(strSecond);

Joden asked:
"I want to get a remote oracle server's time by XADataSource,
use:"select sysdate from dual", but return a null value,and give
the message"sqlexception the jdbc2.0 method is not implemented",
why?"
Let me see your code. A simple executeQuery() should do the trick:
Statement s = c.createStatement();
ResultSet r = s.executeQuery("select sysdate from dual");
while (r.next())
java.sql.Timestamp t = r.getTimestamp(1);
Guillaume Grussenmeyer wrote:
Hi.
I guess you are using weblogic.jdbc.oci.xa.XADataSource as a
datasource.
Weblogic JDriver for Oracle "implementation" is really weak as a lot
of methods are not implemented.
This is why you get this message.
You may find the (very impressive) list of non implemented methods at
http://e-docs.bea.com/wls/docs70/oracle/API_joci.html#1162621 (sorry
HTML links don't seem to work here).
Any call to one of this methods will give you these nasty message and
exception.
Try to use the "official" Oracle JDBC driver XA Datasource
(oracle.jdbc.xa.client.OracleXADataSource) instead of Weblogic JDriver
for Oracle one's.

Similar Messages

  • How can I get back to default in System pref/ displays/ color. iMac 10.9.5

    How can I get back to default in System pref/ displays/ color?  iMac 10.9.5

    Select the iMac option.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • I downloaded and paid for an app on my ipad, how can I get it free on my iphone without using itunes as my laytop is broken. I cannot seem to find the purchase tab in app store? I am logged in using the same ID

    I downloaded and paid for an app on my ipad, how can I get it free on my iphone without using itunes as my laytop is broken. I cannot seem to find the purchase tab in app store? I am logged in using the same ID

    First, the app must be universal...designed for both iPhone/iPad:
    Tap App Store.
    Make sure you're signed in with the same Apple ID used for the original purchase.
    Tap Updates.
    Tap Purchased on the resulting screen.
    Locate the app in your Purchased tab.
    Tap the download icon.
    The app will begin downloading and you'll be taken back to your home screen.

  • Installed office for mac (trial version). now I got 2 excel files, which cannot be deleted. I googled the names of the sheets and found chinese websites I never visited. Are those dialers? How can I get rid of them? system is mac lion(with win 7 parallel)

    now I got 2 excel files, which cannot be deleted on my desktop. I can't open them, either. I googled the names of the sheets and found chinese websites I never visited. Are those dialers? How can I get rid of them? system is mac lion (with win 7 parallel)

    The people who make that stuff have their own forums you can also search/ask in:
    http://answers.microsoft.com/en-us/mac/forum

  • How Can I Get the Amount of Free Disk Space Using space using windows 7 please share example using GetDiskSpace

    How Can I Get the Amount of Free Disk Space  using windows 7 please share example using GetDiskSpace i have already studied http://digital.ni.com/public.nsf/allkb/9958B8E473C4EF1786256BBC0053B64F

    Reading your question a bit more in detail, I doubt whether you are using Win32 API GetDiskFreeSpace function (for which my previous post is the solution) of Programmer's Toolbox GetDiskSpace function.
    With reference to the second one, it works even with disks larger than 2GB but you need to use the proper formatting code to display the returned value. I updated my example to show total free space in the debug output window and added a comparison with 3GB value using UInt64TypeCompareUInt from the Programmer's Toolbox.

  • If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper;  in others one is created for each song. Why? How can I get one image per album every time?

    If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper;  in others one is created for each song. Why? How can I get one image per album every time?

    If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper;  in others one is created for each song. Why? How can I get one image per album every time?

  • How can I get the adobe audition software which is used for editing a sound track?

    How can I get the adobe audition software which is used for editing a sound track?

    Hi pravupada,
    You can download Audition software from : Free Audition CC | Download Adobe Audition free trial
    Regards,
    Rave

  • HT1338 HOW CAN I FIND OUT WHICH SERVER MY MAC IS USING?

    HOW CAN I FIND OUT WHICH SERVER MY MAC IS USING, KEEP GETTING MICROSOFT SQL SERVER ERRORS
    WHEN TYPING IN ADDRESS'S?

    If your computer is tied to a network, then there is a way to check. Go to System Preferences, and click Accounts. unlock Admin
    then you can click Login Options.
    under that, Network Account Server. This should show you what server your computer is tied to. If you aren't in the tech department, you could try asking them.

  • How can I determine what dns server the wifi client use within airport

    How can I determine what dns server the wifi client use within airport
    I want to use dns servers other then the one that airport extreme is using. For example I got the 172.16.1.1 (the default gateway - airport extreme), but I want to use the office dns servers, that are in a 10.x.x.x range.
    Is there a possibility?
    Thanks and happy eastern

    The Airport Extreme uses the DNS servers assigned by the network that it connects to. Is you Airport Extreme on the 10.x.x.x network? if it is then you are already using the 10.x.x.x DNS servers. Check your Airport Extreme with the Airport Utility and you will see in the Internet tab, the DNS servers used. The devices connecting to the Airport Extreme are assigned a DNS address of the Airport Extremes IP, In your case 172.16.1.1 but all DNS searches and resolution are done with the DNS servers you see in the Airport Extreme.
    If you want to use some other DNS then you can override in the Airport Extreme which will be used by all devices connecting too the Airport Extreme, Or you can edit the DNS address in each devices wireless settings.

  • How can I get specific files back from my Time Machine backup?

    I wanted to make a fresh install on my MacBook Pro, in order to only have Java 8 instead of any older Java versions. So far so good. But now I want to get specific files/libraries from my external backup (USB):
    One Parallels Virtual Machine
    My old mail
    My iPhoto Library
    I don't need any settings for these, since I can easily configure them again.
    I already used the Migration Assistent to restore all apps.
    How can I get specific data back from the backup without restoring all stuff that I don't want anymore?
    I'm now working on a new account on the fresh system, called 'Admin'. My old account was called 'Hans' (or 'hans') and I'd like to create such an account again for all my tasks.
    Hans

    How can I get specific data back from the backup without restoring all stuff that I don't want anymore?
    I'm now working on a new account on the fresh system, called 'Admin'. My old account was called 'Hans' (or 'hans') and I'd like to create such an account again for all my tasks.
    You will want to add the same User account(s) which hold the data you want to restore. So you will want to add a User account of 'Hans or hans'. Check your Time Machine back up drive to see how the User account is labeled (Hans or hans). Navigate to the Users folder and see how it's labeled.
    You can then use your Time Machine back up drive and navigate to the User Home folder to copy its data over (e.g. contents from Documents, Downloads, Music, Pictures, etc.). Repeat for other Users.

  • Using JSDK 1.4, How can I get disk names in Windows system?

    Using JDK1.3,I can got disk names via:
    FileSystemView.getFileSystemView().getRoots();
    Or, aFile.listRoots();
    Now, I will switch to JSDK1.4, the aformentioned methods only returns me "D:\Documents and Settings\Administrator\desktop", no disk name returned.
    So, How can I get them back?
    Note: To keep compatible with JSDK1.3, I do not want to use new APIs since 1.4.
    Thank you in advance.

    I get mine at NetBeans:
    FileSystemView.getShellFolder: f=C:\Program Files\NetBeans IDE 3.5\::{450D8FBA-AD25-11D0-98A8-0800361B1103}
    java.io.FileNotFoundException
    at sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:197)
    at javax.swing.filechooser.FileSystemView.getShellFolder(FileSystemView.java:459)
    at javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:179)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI$ShortCutPanel.<init>(WindowsFileChooserUI.java:592)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(WindowsFileChooserUI.java:355)
    at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:130)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(WindowsFileChooserUI.java:175)
    at javax.swing.JComponent.setUI(JComponent.java:445)
    at javax.swing.JFileChooser.updateUI(JFileChooser.java:1701)
    at javax.swing.JFileChooser.setup(JFileChooser.java:345)
    at javax.swing.JFileChooser.<init>(JFileChooser.java:320)
    at javax.swing.JFileChooser.<init>(JFileChooser.java:273)
    at Infoseer.<init>(Infoseer.java:265)
    at Infoseer.main(Infoseer.java:3820)
    java.lang.NullPointerException
    at javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:180)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI$ShortCutPanel.<init>(WindowsFileChooserUI.java:592)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(WindowsFileChooserUI.java:355)
    at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:130)
    at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(WindowsFileChooserUI.java:175)
    at javax.swing.JComponent.setUI(JComponent.java:445)
    at javax.swing.JFileChooser.updateUI(JFileChooser.java:1701)
    at javax.swing.JFileChooser.setup(JFileChooser.java:345)
    at javax.swing.JFileChooser.<init>(JFileChooser.java:320)
    at javax.swing.JFileChooser.<init>(JFileChooser.java:273)
    at Infoseer.<init>(Infoseer.java:265)
    at Infoseer.main(Infoseer.java:3820)

  • How can I get my files in my ipad 3(using keynotes) to my PC?

    I store my document in my keynote and I want to get it through my PC. How can I get those files?

    Download and Install the Windows Support Software (1st task in Boot Camp).

  • How can i get rid of an old email i used as an apple id

    I had an old  email address i used as an apple id. I have a new one now but occasioally the email and id which i no longer have keeps popping up. how can i get rid of it from my iphone and ipad?

    Hi Chuck,
    If you are occasionally prompted for your previous Apple ID, you may find the following article helpful:
    iOS 7: If you're asked for the password to your previous Apple ID when signing out of iCloud
    http://support.apple.com/kb/ts5223
    Regards,
    - Brenden

  • TS1717 My song previews are quitting after about 20 seconds. How can I get it to play the full time allowed?

    My song previews in the itunes store quit after about 20 seconds.  How can I get the full time allowed?

    Delete and redownload:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • How can I get auto correct to recognize a name used very often? It is in my address book but auto correct does t recognize it?

    How can I get auto correct on my iPhone 4 to recognize a name that is already in my address book? It doesn't recognize it and offers no suggestions.

    The cleanest way to get things straight now and as you proceed into the future with Time Machine is to start over. If the new machine is setup the way you want and has all the data placed onto it I suggest you erase and re-format the TM backup device and start a Full initial TM backup.
    I believe this will pay dividends now and over time and avoid future problems for you. Jst before going to bed crank up the Full TM backup and it will be all done by morning time.

Maybe you are looking for

  • PC Suite 6.81.13.0 and the N91

    Hi, I'm running normal Windows XP SP2, on a stable system, admin rights, with anti-virus, the works... My PC Suite is the latest version (6.81.13.0), and the firmware is the original, that the phone was shipped with. I was trying to update my N91's F

  • Icloud: mail doesn't work

    I can't change the incoming server name (name now is p15-imap.mail.me.com) how can i change the name? I can send mails on my account, but not receive. I need it becaus i want to use it also for my iphone 4.

  • 2 questions about PPTP VPN on 878

    Hello, I've configured my 878 router as a PPTP VPN server. It works very fine and very quickly. Using the XP VPN client from a remote site, I can "see" all servers in my network. 2 questions 1) When doing telnet on the 878 through the VPN, it is very

  • Firefox cannot load websites when connect/disconnect from any VPN connection

    I am consistently uses OpenVPN and RamsesVPN connectivity. But whenever i switch between the VPN connectivity or connect into any VPN or disconnects existing VPN connectivity. My Firefox Browser is unable to load new webpages/Refresh existing open TA

  • Modifying default permissions? (Answered)

    A little while back, I discovered a way for the system to automatically make the permissions of files I create 0640. I've changed my mind about that now (since a permissions problem gave me hell with sqlite all day), and I've forgotten what I can do