How to pass parameters to java when calling java from Oracle PLSQL

I am trying to call a java function from plsql to return a csv item at a certain index in a csv string. The csv string can also contain separators within quotes (based on this Stack Overflow question). The code set serverout on size 100000 CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "XxpayCsv" AS import java.io.ByteArrayInputStream; public class XxpayCsv { public static String csv(St

从Oracle PLSQL调用java时如何将参数传递给java

我试图从plsql调用一个java函数来在csv字符串中的某个索引处返回一个csv项目。 csv字符串还可以在引号内包含分隔符(基于此堆栈溢出问题)。 代码 set serverout on size 100000 CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "XxpayCsv" AS import java.io.ByteArrayInputStream; public class XxpayCsv { public static String csv(String line, Integer idx) { String otherThanQuote = " [^"] ";

02089 with Java

I'm getting the following error when trying to call a PL/SQL stored procedure from Java: ORA-02089: COMMIT is not allowed in a subordinate session It tests fine from Oracle. Does anyone have any experience with this? Try this ways; Change the data source to use Non-XA (and check the “Supports Global Transactions” & “Emulate Two-Phase Commit” buttons) Delete the COMMIT from your c

02089与Java

在尝试从Java调用PL / SQL存储过程时遇到以下错误: ORA-02089: COMMIT is not allowed in a subordinate session 它从Oracle测试得很好。 有人对这个有经验么? 尝试这种方式; 将数据源更改为使用非XA(并检查“支持全局事务”和“模拟两阶段提交”按钮) 从代码中删除COMMIT。 使用“PRAGMA AUTONOMOUS_TRANSACTION”。 这将创建一个单独的事务,允许使用提交。例如:CREATE PROCEDURE XXX AS PRAGMA AUTONOMOUS_TRANSAC

Java: Date from unix timestamp

I need to convert a unix timestamp to a date object. I tried this: java.util.Date time = new java.util.Date(timeStamp); Timestamp value is: 1280512800 The Date should be "2010/07/30 - 22:30:00" (as I get it by PHP) but instead I get Thu Jan 15 23:11:56 IRST 1970 . How should it be done? For 1280512800 , multiply by 1000, since java is expecting milliseconds: java.util.Date ti

Java:来自unix时间戳的日期

我需要将一个unix时间戳转换为一个日期对象。 我试过这个: java.util.Date time = new java.util.Date(timeStamp); 时间戳值是: 1280512800 日期应该是“2010/07/30 - 22:30:00”(因为我是通过PHP获得的),但是我得到的是Thu Jan 15 23:11:56 IRST 1970 。 应该怎么做? 对于1280512800 ,乘以1000,因为java期望毫秒: java.util.Date time=new java.util.Date((long)timeStamp*1000); 如果你已经有了毫秒,那

Java Hashmap: How to get key from value?

If I have the value "foo" , and a HashMap<String> ftw for which ftw.containsValue("foo") returns true , how can I get the corresponding key? Do I have to loop through the hashmap? What is the best way to do that? If you choose to use the Commons Collections library instead of the standard Java Collections API, you can achieve this with ease. The BidiMap interface i

Java Hashmap:如何从价值中获取密钥?

如果我的值为"foo" ,并且ftw.containsValue("foo")返回true的HashMap<String> ftw ,我怎样才能获得相应的键? 我必须循环散列图吗? 什么是最好的方式来做到这一点? 如果您选择使用Commons Collections库而不是标准Java Collections API,则可以轻松实现此目的。 在类别库中的接口BidiMap是双向地图,允许你映射一键的值(如正常的地图),以及映射的值的键,从而使你在两个方向上执行查找。

Why Calendar.SEPTEMBER is not working?

I want to see a month which contains whole days. private void createRandomData(InMemoryCursor cursor) { List<Object[]> data = new ArrayList<>(); Calendar today = Calendar.getInstance(TimeZone.getDefault(), Locale.getDefault()); today.set(Calendar.HOUR_OF_DAY,0); today.set(Calendar.MINUTE, 0); today.set(Calendar.SECOND, 0); today.set(Calendar.MILLISECOND, 0);

为什么Calendar.SEPTEMBER不工作?

我想看一个包含整整一天的月份。 private void createRandomData(InMemoryCursor cursor) { List<Object[]> data = new ArrayList<>(); Calendar today = Calendar.getInstance(TimeZone.getDefault(), Locale.getDefault()); today.set(Calendar.HOUR_OF_DAY,0); today.set(Calendar.MINUTE, 0); today.set(Calendar.SECOND, 0); today.set(Calendar.MILLISECOND, 0); mStart = (Calen

What's the simplest way to print a Java array?

In Java, arrays don't override toString() , so if you try to print one directly, you get the className + @ + the hex of the hashCode of the array, as defined by Object.toString() : int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray); // prints something like '[I@3343c8b3' But usually we'd actually want something more like [1, 2, 3, 4, 5] . What's the simple

打印Java数组最简单的方法是什么?

在Java中,数组不会覆盖toString() ,因此如果您尝试直接打印一个数据,您将得到className + @ +数组的hashCode的十六进制数,如Object.toString()所定义的那样: int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray); // prints something like '[I@3343c8b3' 但通常我们实际上需要更多的东西,如[1, 2, 3, 4, 5] 。 这样做最简单的方法是什么? 以下是一些示例输入和输出: // array of primit

Jollyday CalenderUtil

I have a little problem with my project: URI /TimeKeeper/calendar/show Class groovy.lang.MissingMethodException Message No signature of method: static de.jollyday.util.CalendarUtil.create() is applicable for argument types: (java.util.GregorianCalendar) values: [java.util.GregorianCalendar[time=1406897280000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo

Jollyday CalenderUtil

我的项目有一点问题: URI / TimeKeeper / calendar / show 类 groovy.lang.MissingMethodException 消息没有方法的签名:static de.jollyday.util.CalendarUtil.create()适用于参数类型:(java.util.GregorianCalendar)values:[java.util.GregorianCalendar [time = 1406897280000,areFieldsSet = true,areAllFieldsSet =真实,宽容= TRUE,区= sun.util.calendar.ZoneInfo [ID = “欧洲/柏林”,偏移量= 3600000,d

How to maintain the same session id across multiple web applications in Java

如何在Jboss服务器中为多个Web应用程序维护相同的会话ID? Take a look at this post, for similar question. Access session of another web application What this is saying is "Not directly. Most containers put each WAR in a separate classloader with the EAR classloader as their parent. Each app's sessions are separate. You can put something provided by the parent EAR in each session. If yo

如何在Java中的多个Web应用程序中保持相同的会话ID

如何在Jboss服务器中为多个Web应用程序维护相同的会话ID? 看看这篇文章,看看类似的问题。 访问另一个Web应用程序的会话 这是说什么 “不是直接的,大多数容器将每个WAR放在一个单独的类加载器中,并且EAR classloader作为它们的父类,每个应用程序的会话都是独立的,你可以在每个会话中放入父EAR提供的东西,如果你需要它们共享某些东西,一个EAR功能“。 所以,由于每个会话都是私人的,所以一个网络应用不能看到另一个

Override Logback error output

In my custom exception class I've overridden toString() : @Override public String toString() { final String msg = getLocalizedMessage(); // base String str = getClass().getName() + ": [" + code + "]"; // message if (msg != null) str += " " + msg; // extra if (extra != null) { str += 'n' + extra.toString(); } return str; } (yes, I'm

覆盖Logback错误输出

在我自定义的异常类中,我重写了toString() : @Override public String toString() { final String msg = getLocalizedMessage(); // base String str = getClass().getName() + ": [" + code + "]"; // message if (msg != null) str += " " + msg; // extra if (extra != null) { str += 'n' + extra.toString(); } return str; } (是的,我知道我应该在那里使用

com.android.camera.action.CROP sets wallpaper on Motorola Defy

I'm working on an Android 2.1+ app and trying to take a photo and then send the results of that intent to a crop function. It seems to work on the Sony Ericsson xmp, but when i put it on a Moto Defy, the crop function fails because it is seemingly ignoring the file name i put in for the data, and instead looks at /data/data/com.motorola.gallery/files/temp-wallpaper for some reason. This has

com.android.camera.action.CROP在摩托罗拉Defy上设置壁纸

我正在开发Android 2.1+应用程序,并尝试拍摄照片,然后将该意图的结果发送到裁剪功能。 它似乎在索尼爱立信xmp上工作,但是当我将它放在Moto Defy上时,裁剪功能失败,因为它似乎忽略了我为数据放入的文件名,而是查看/data/data/com.motorola.gallery/files/temp-wallpaper出于某种原因。 这是因为裁剪功能不会返回任何数据,而我刚刚拍摄的图像被设置为手机的壁纸图像! 以下是一些示例代码: public static final String