| Applet as DSO in Browser example? MSIE only? |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- Hibernate, connection pool and firewall questionAn odd combination of topics, to be sure.
My current web application (Tomcat hosted) has a custom-rolled
connection pool. The Informix DB I connect to is across a firewall
that terminates existing connections after 120 minutes, regardless of
their current activity. My pool handles this by detecting the
creation date of a connection it wants to reuse. If that connection
was created > 60 minutes ago it closes the connection and fetches a
replacement to use in the pool.
Simply using a connection until the 120 minute barrier is reached
isn't acceptable because the DB isn't smart enough to realize that the
firewall has stopped the connection's use. The explicit release after
60+ minutes releases the connection and keeps the simultaneous
connection use down (we are licensed by the number of simultaneous
connections).
When I look at Hibernate and its connection pools (DBCP and C3P0,
there might be others) I'd like to use their stuff instead of my
home-grown pool. But I don't really see a parameter like "only use
this connection for 60 minutes" or such. Can I find such a parameter
in one of the pool possibilities?
TIA,
Jerome.
- 3
- Getting ready for 1.5I'd like to prepare for JDK 1.5. I know that generics/templates
will be in there. Will standard Java classes be retofitted to
use this new feature as appropriate? I'm thinking of course
about the collections, but also wondering about stuff such as
the clone interface.
I also know that enums will be in there. (Because the bug status
changed to closed/fixed.) But in what form? There were at least
two JSRs for that last time I checked.
Thanks!
-Wayne
- 3
- Python and cellular automata (It works this time!)I thought people would be interested in this little script I wrote to
reproduce the 256 simple automata that is shown in the first chapters
of "A New Kind of Science". You can see a few results without running
the script, at http://cooper-j.blogspot.com . And here is the code (You
will need PIL (Python Imaging Library)):
<code>
import Image
# Contract:
# To simulate simple cellular automata.
class calculations:
def __init__(self,which):
self.against = self.array_maker_2()[which]
self.check = self.array_maker_1()
self.array = self.array_maker_3(311)
self.calculator()
def binary(self, n, size): ## This is the Int -> str(BINARY)
converter
assert n >= 0
bits = []
while n:
bits.append('01'[n&1])
n >>= 1
bits.reverse()
result = ''.join(bits) or '0'
for iteration in range(len(result),size):
result = "0" + result
return result
def array_maker_1(self): # This makes the array that represents the
8 different permutations of 3 cells. Itself, its left and its right.
return [self.binary(n, 3) for n in range(8)]
def array_maker_2(self): # This makes the array that represents
every single different rule. If for instance the second element in one
# of these rules is 1, then the corresponding permutation that may
be found in the result array (array_maker_3), will be 1 (black).
return [self.binary(n, 8) for n in range(256)]
def array_maker_3(self, y): # This is the array for all the
results. The automaton starts from the middle of the first row
x = [["0" for x in range((2*y)+1)] for n in range(y)]
x[0][(2*y+1)/2] = "1"
return x
def calculator(self): # This cycles over all of the cells, and
scans one row at a time, and changes the next row according to the
current cell.
self.buff_result = ["0","0","0"] # This is the current permutation
buffer to be checked against the corresponding arrays.
for i in range(len(self.array)-1):
for j in range(1, len(self.array[0])-1):
self.step1(j,i)
self.step2(j,i)
self.step3(j,i)
y = self.check.index(''.join(self.buff_result))
self.array[i+1][j] = self.against[y]
# The steps update the result buffer.
def step1(self, step, y):
self.buff_result[0] = self.array[y][step-1]
def step2(self, step, y):
self.buff_result[1] = self.array[y][step]
def step3(self, step, y):
self.buff_result[2] = self.array[y][step+1]
for number in range(256):
objo = calculations(number)
x = objo.array
y = []
for num,zo in enumerate(x):
for com,wo in enumerate(zo):
x[num][com] = int(wo)
nim = Image.new("1", (623,311))
for n in x: #converting the array of arrays into a single array so
putdata can take it.
for p in n:
y.append(p)
nim.putdata(y)
nim.resize((6230/2,3110/2)).save("output" + str(number) + ".png")
print number
</code>
- 4
- RSA encrypt session keyDoes anyone know how to encrypt a secret key with a public key algorithm
to transmit it to another computer securely. Have tried using RSA and
have had no look in the following code:
public byte[] encryptSessionKey(SecretKey sKey, PrivateKey pKey, String
algorithm)
{
System.out.println("linex");
Cipher cipher = Cipher.getInstance(algorithm+"/ECB/PKCS#1");
System.out.println("liney");
cipher.init(Cipher.WRAP_MODE, pKey);
System.out.println("linez");
return cipher.wrap(sKey);
}
It prints out liney but not linez which suggests the Cipher object can
not encrypt a session key in wrap mode.
Thanks.
- 4
- JVM sourcesHi,
Where can I find C sources for JVM 1.4 for Windows ?
Thanks
Xavier
- 7
- Returning a reference to an objectHi,
I've created a class to implement a state machine, so it's got a State
attribute. It has algo got a private java.util.Stack attribute.
In order to work, State classes need to access the stack to push and pop
data, etc.
To access it from State, I have wrote a method called getStack() which
returns a reference to the stack, but I think this is not recommended
beacause all objects sharing the reference can modify it, and led to errors
difficult to debug, etc. Returning a stack's clone is not valid solution,
as I have to make changes on the real one.
So my question is, is there a cleaner way to do this?
Thank you very much
--
PGR
- 9
- TRYING TO CREATE A SIMPLE FORM. HELP HELP HELP!!!!trying to make a simple form, just an empty window with no button.
ive tried this
import javax.swing.*;
import java.awt.*;
import java.util.List;
import java.util.*;
public class Canvas
{
private static Canvas canvasSingleton;
public static Canvas getCanvas()
{
if(canvasSingleton == null) {
canvasSingleton = new Canvas("BlueJ Shapes Demo", 300, 300,
Color.white);
}
canvasSingleton.setVisible(true);
return canvasSingleton;
}
}
but it doesnt work :( any ideas guys?
- 11
- eclipse, integrating crystal reports plugin with rcp appHello,
I have got a problem, I have to integrate Crystal Reports plugin with
my RCP app. I want Crystal Reports perspective aviable in my
application.
I've downloaded crystal reports plugin, and unpacked it to my_rcp_app
\plugins,
and I've run eclipse with -clear flag. but crystal reports plugin
isn't visible in Plug-In details window.
How can I cope with that problem ?
Is the any tutorial, or sth. about integrating plugins with RCP app ?
thanks a lot for any help
- 13
- jigsaw's jdbmI like that I can use the jigsaw outside if jdbm. For
writing j2me (personal java) that don't have any sort
of record manager on the device I want to also use
jdbm there. However jdbm requires some of the file
classes that are not universally available within
j2me. I don't have the error posting just now (stupid
me) from javac to show what's missing. Has anyone
worked through this or have another idea for an
embedded data (flatfile) manager for j2me?
Mike
- 13
- Axis e Web ServiceSalve,
sto realizzando un applicazione Java che utilizza un Web Service con
Eclipse 3.2.
Questo Web Service ha il compito di salvare un oggetto su database
MySQL facendo uso delle librerie di Hibernate 3.1.3.
L'applicazione gira su un server Tomcat 5.5 che fa uso delle librerie
j2sdk1.4.2_10 e utilizza librerie di Axis 1.4 per i Web Service.
L'applicazione ?in realt?costituita da un applicazione client che
richiama il Web Service ed un applicazione server che si preoccupa di
salvare gli oggetti sul database. Eseguendo il client ottengo il
seguente errore:
AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.InvocationTargetException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:notebook-pc
java.lang.reflect.InvocationTargetException
at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at source.Start.main(Start.java:42)
In particolare ho notato che questo si verifica nel momento in cui si
invoca un metodo chiamato "save" messo a disposizione da Hibernate. Se
commetto la riga corrispondente a tale istruzione, richiedendo al web
service di restituire semplicemente una stringa, l'applicazione
funziona correttamente. Suppongo che il problema derivi dal database
MySQL, ma non capisco di cosa si tratta. Avete qualche idea?
- 13
- Read the index of item with X value.On Mar 26, 10:42 pm, "Mariano" <email***@***.com> wrote:
> I've a ComboBox ..
>From where? There is no ComboBox in the JSE.
Are you perhaps referring to java.awt.Choice,
or javax.swing.JComboBox?
..
> How could I resolve?
1) Be specific about the classes used, rather
than simply 'making the names up, as you go along'
2) ..
Andrew T.
- 14
- Faster JPEG Decoder?On 19 Aug 2005 16:14:17 -0700, email***@***.com wrote or quoted :
>Currently we use JPEGImageDecoder which is the fastest of the three but
>still it takes up a lot of CPU time.
>
>Any suggestion? Thanks in advanced.
The obvious thing to consider is to predigest your images into some
other format that does not require so much processing to fluff it up.
They will probably be bigger.
When you create the jpg images you can control the
compression/quality. Presumably lower quality images will display
faster.
If you are displaying them or scrolling over them, then you might look
into what speedups are possible with VolatileImage.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
- 14
- Licence code storing for java appHello,
I want to create a app which will have something similar to licence
(i.e. user have to enter licence code to run the app). The problem
arises when I want to make it that user have to specify it only once.
So I need to store somewhere the information, that the app has already
been activated. I am thinking about main jar file (as something which
can work ,although it is nothing sophisticated), but when I add extra
characters at the end then my jar was corrupted :(. Do you know any
nice way to do this:)? Thank you!
Regards, mark
- 14
- looking for some hands on experience... i have bought and read LEARNING JAVA by niemeyer
i loved it but find i need some hands on experience.
any help?
kevin
--
Sometimes I'm in a good mood.
Sometimes I'm in a bad mood.
When all my moods have cum to pass
i hope they bury me upside down
so the world can kiss me porcelain,
white, Irish bottom.
- 15
- Java application help?????????????How do you create a pause in a Java application that requires you to
press a key to continue until the conditional statement is complete?
The folowing is what I have so far..
class Count{
public static void main(String[] arguments) throws Exception {
int a = 100;
int b = 20;
int x;
for (x = 0;x < a;x++) {
System.out.println((x+1) + "." + "Message goes here to be displayed
100 times.");
}
I would like the application to display 1 - 20 then pause and display
20 more and 20 more and so on. I tried to use System.in.read();, but
it only displayed two at a time. Please Help.
|
| Author |
Message |
Richard Maher

|
Posted: 2007-3-10 9:24:00 |
Top |
java-programmer, Applet as DSO in Browser example? MSIE only?
Hi,
Recently on the web I came across documentation discussing Data Source
Objects (DSO) in relation to browser and html functionality (in particular
the ability to declare a Java applet as a data source that can be used with
any or the HTML tags that take the src="" attribute). I find it interesting
and potentially *very* useful and would like to know more, so if anyone can
answer any of the following questions that would be great: -
1) Do you have an example of an Applet functioning as an applet to something
like a <Table> that I can see?
2) Is this a MicrosoftIE-only feature? I can't find it in other html tag
reference sites. (I'm using w3schools as a sort of yardstick; is that less
than optimal?) What do other browsers do? Is Microsoft deprecating this
along with other Java stuff?
3) I've searched in c.l.j.p/c.l.javascript and the only references to DSOs
appear to be server based (or data sources other than Applet) I'm guessing
they're entirely different beasts; is that correct?
4) Anyone ever passed a BufferedImage over to Javascript for display on a
web page? (I know it'd be single threaded and all those little .GIFs and
.JPEGs are designed for parallel http webservers, but think of a blob in a
database that has an employee photo of geological survey or something. . .)
Thanks for any help!
Regards Richard Maher
PS. I am already passing result set <options>s back to a <select> list quite
happily; it's the tighter integration between the html tags and my socket
that I'm striving for here.
One of the places I've been looking: -
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/databind/datasources.asp
|
| |
|
| |
 |
VK

|
Posted: 2007-3-11 3:01:00 |
Top |
java-programmer >> Applet as DSO in Browser example? MSIE only?
On Mar 10, 4:24 am, "Richard Maher" <email***@***.com>
wrote:
> Recently on the web I came across documentation discussing Data Source
> Objects (DSO) in relation to browser and html functionality
That was a long waiting ;-) - DSO / Data Binding is supported since IE
4.0
All relevant tags and attributes are part of HTML 4 DTD
> (in particular
> the ability to declare a Java applet as a data source that can be used with
> any or the HTML tags that take the src="" attribute).
I don't agree with such concept description.
DSO is part of Microsoft Data Binding technology. First you define a
an object on your page connected with tabular data source on your
server (static or dynamic). It is made by using data binding ActiveX
object coming with IE installation. The reference to Java applet on
MSDN is a bit mysterious to me. I guess for IE 4/5 Microsoft allowed
to use their JVM for bridging to the needed ActiveX, so people could
use either <object> or <applet> depending on personal preferences. In
either case it is definitely in relation to the Microsoft own JVM
which is not provided any more. It has nothing to do with Sun plugin.
After DSO object properly initialized, you map (bind) particular data
columns in the source to relevant columns in HTML table template. This
way you don't need to build the table itself - it gets filled and
updated automatically on source data change. Later DSO Microsoft
proposed IXMLHTTPRequest object. Current AJAX is IXMLHTTPRequest
pulled out by rivals out of sense and context from Microsoft Data
Binding. They got the motor but they left everything else out. Instead
XHR got transformed into some "hidden browser" used for manual data
retrieval and manual page updates. Seems very silly and ineffective
but I guess developers didn't have any choice for cross-browser
solutions. Besides Gecko browsers with XBL support all other UAs stock
in the middle age of the data treatment and still cannot get onto
mainstream.
> I find it interesting
> and potentially *very* useful and would like to know more, so if anyone can
> answer any of the following questions that would be great: -
>
> 1) Do you have an example of an Applet functioning as an applet to something
> like a <Table> that I can see?
For DSO / data binding hardly such sample can be provided - see above.
It is easy to imagine an applet or flash retrieving data from server
and then communication with the host document DOM to display such
data. But it really adds nothing to a regular ajaxoid made with
javascript.
> 2) Is this a MicrosoftIE-only feature?
As DSO / Data Binding / relevant HTML tags and attributes - yes, it is
Windows IE only feature.
> I can't find it in other html tag
> reference sites. (I'm using w3schools as a sort of yardstick; is that less
> than optimal?)
Use the producer manuals instead:
http://msdn.microsoft.com/workshop/author/databind/data_binding.asp
> 3) I've searched in c.l.j.p/c.l.javascript and the only references to DSOs
> appear to be server based (or data sources other than Applet) I'm guessing
> they're entirely different beasts; is that correct?
Not sure if I understood the question properly. DSO is external to the
document. It is a bridge between a tabular data server-side and data
binding capable HTML "display" client-side. Because of the technology
remained IE-only you will not find many discussions of it on clj. You
will have much better results on microsoft.public.* forums
> 4) Anyone ever passed a BufferedImage over to Javascript for display on a
> web page?
What is BufferedImage in context of "passed over to javascript"?
Javascript doesn't have byte-level access to images. All you can pass
to it is image URL.
|
| |
|
| |
 |
Richard Maher

|
Posted: 2007-3-17 20:14:00 |
Top |
java-programmer >> Applet as DSO in Browser example? MSIE only?
Hi VK,
Thanks for the detailed reply!
"VK" <email***@***.com> wrote in message
news:email***@***.com...
> That was a long waiting ;-) - DSO / Data Binding is supported since IE
Doin' my best to catch up.
> > (in particular
> > the ability to declare a Java applet as a data source that can be used
with
> > any or the HTML tags that take the src="" attribute).
>
> I don't agree with such concept description.
That's exactly what my rose-coloured glasses (or beer-goggles) told me it
did :-)
> In
> either case it is definitely in relation to the Microsoft own JVM
> which is not provided any more. It has nothing to do with Sun plugin.> >
2) Is this a MicrosoftIE-only feature?
>
> As DSO / Data Binding / relevant HTML tags and attributes - yes, it is
> Windows IE only feature.
>
OK, that's all very disappointing.
> It is easy to imagine an applet or flash retrieving data from server
> and then communication with the host document DOM to display such
> data.
Certainly is.
> But it really adds nothing to a regular ajaxoid made with
> javascript.
You seem confident.
Cheers Richard Maher
"VK" <email***@***.com> wrote in message
news:email***@***.com...
> On Mar 10, 4:24 am, "Richard Maher" <email***@***.com>
> wrote:
> > Recently on the web I came across documentation discussing Data Source
> > Objects (DSO) in relation to browser and html functionality
>
> That was a long waiting ;-) - DSO / Data Binding is supported since IE
> 4.0
> All relevant tags and attributes are part of HTML 4 DTD
>
> > (in particular
> > the ability to declare a Java applet as a data source that can be used
with
> > any or the HTML tags that take the src="" attribute).
>
> I don't agree with such concept description.
> DSO is part of Microsoft Data Binding technology. First you define a
> an object on your page connected with tabular data source on your
> server (static or dynamic). It is made by using data binding ActiveX
> object coming with IE installation. The reference to Java applet on
> MSDN is a bit mysterious to me. I guess for IE 4/5 Microsoft allowed
> to use their JVM for bridging to the needed ActiveX, so people could
> use either <object> or <applet> depending on personal preferences. In
> either case it is definitely in relation to the Microsoft own JVM
> which is not provided any more. It has nothing to do with Sun plugin.
>
> After DSO object properly initialized, you map (bind) particular data
> columns in the source to relevant columns in HTML table template. This
> way you don't need to build the table itself - it gets filled and
> updated automatically on source data change. Later DSO Microsoft
> proposed IXMLHTTPRequest object. Current AJAX is IXMLHTTPRequest
> pulled out by rivals out of sense and context from Microsoft Data
> Binding. They got the motor but they left everything else out. Instead
> XHR got transformed into some "hidden browser" used for manual data
> retrieval and manual page updates. Seems very silly and ineffective
> but I guess developers didn't have any choice for cross-browser
> solutions. Besides Gecko browsers with XBL support all other UAs stock
> in the middle age of the data treatment and still cannot get onto
> mainstream.
>
> > I find it interesting
> > and potentially *very* useful and would like to know more, so if anyone
can
> > answer any of the following questions that would be great: -
> >
> > 1) Do you have an example of an Applet functioning as an applet to
something
> > like a <Table> that I can see?
>
> For DSO / data binding hardly such sample can be provided - see above.
> It is easy to imagine an applet or flash retrieving data from server
> and then communication with the host document DOM to display such
> data. But it really adds nothing to a regular ajaxoid made with
> javascript.
>
> > 2) Is this a MicrosoftIE-only feature?
>
> As DSO / Data Binding / relevant HTML tags and attributes - yes, it is
> Windows IE only feature.
>
> > I can't find it in other html tag
> > reference sites. (I'm using w3schools as a sort of yardstick; is that
less
> > than optimal?)
>
> Use the producer manuals instead:
> http://msdn.microsoft.com/workshop/author/databind/data_binding.asp
>
> > 3) I've searched in c.l.j.p/c.l.javascript and the only references to
DSOs
> > appear to be server based (or data sources other than Applet) I'm
guessing
> > they're entirely different beasts; is that correct?
>
> Not sure if I understood the question properly. DSO is external to the
> document. It is a bridge between a tabular data server-side and data
> binding capable HTML "display" client-side. Because of the technology
> remained IE-only you will not find many discussions of it on clj. You
> will have much better results on microsoft.public.* forums
>
> > 4) Anyone ever passed a BufferedImage over to Javascript for display on
a
> > web page?
>
> What is BufferedImage in context of "passed over to javascript"?
> Javascript doesn't have byte-level access to images. All you can pass
> to it is image URL.
>
>
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Ethernet ID and system Info in JavaHi,
I want to know if there is a way to get system level information using Java.
I am mostly interested in things like Ethernet ID and serial number of Hard
disk. Some of the values when you type "ipconfig /all" on windows.
I know we can do all this using JNI with the main routines written in C. But
is there a way to do it using Java alone?. I have not seen any API to help
me get such deep system level information.
Thanking you,
- 2
- 3
- java.netHello
How can I get the ip and mac address of the networking device
(eth0)?? is it possible with the InetAddress??
I want to get the ip address given by the ISP.
Sincerly
DigitaluX
- 4
- bsd implementation ofOn Thu, Jan 17, 2008 at 08:13:00PM -0800, Michael Allman wrote:
> There's a bug in the bsd patch to FileChannelImpl.c, as described in the
> subject of this message. FYI, I have verified this using the "current"
> jdk16 freebsd patchset found here:
>
> http://www.eyesbeyond.com/freebsddom/java/JDK16JRLConfirm.html
D'oh...there certainly is.
> I haven't fully analyzed the impact of this defect. I can say that in my
> case, if I call FileChannel.transferTo(0, 100, socketChannel), where 100
> is less than the length of the file in question, it transfers the entire
> file to the destination. According to the docs for this method, it should
> only transfer a maximum of 100 bytes. This is key to my particular usage
> of this method.
The problem is that it ignores the count entirely and just transfers the
whole thing.
> I can attempt to provide a patch, but C is not my thing, and I could not
> make a reliable claim as to the correctness of my patch. Also, there's
> the whole license issue. Fixing this seems simple enough, though. I
> would like to help insofar as I can.
Something like this maybe? (Untested)
--- ../../j2se/src/solaris/native/sun/nio/ch/FileChannelImpl.c 6 Mar 2007 17:45:05 -0000 1.11
+++ ../../j2se/src/solaris/native/sun/nio/ch/FileChannelImpl.c 18 Jan 2008 08:11:36 -0000
@@ -264,11 +264,12 @@
return IOS_THROWN;
}
- while ((r = pread(srcFD, buf, 4096, offset)) > 0) {
+ while (count > 0 && (r = pread(srcFD, buf, (count < 4096) ? count : 4096, offset)) > 0) {
w = write(dstFD, buf, r);
if (w == -1)
break;
offset += w;
+ count -= w;
}
free(buf);
> Also, I know this is getting pushy, but it seems like fixing this issue
> would be a great time to replace the current implementation of this method
> with a true bsd sendfile() call. I could give that a try, too.
As noted in the comments, you can't since the BSD implementation of
sendfile(2) expects to be sending the file to a socket, not just any old
file descriptor. Solaris and Linux are both ok with any old fd.
--
Greg Lewis Email : email***@***.com
Eyes Beyond Web : http://www.eyesbeyond.com
Information Technology FreeBSD : email***@***.com
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 5
- how to read multiple (binary) lines from text file / stdin?
hi group!
i am writing a small tool to dump data from oracle databases and i want
to implement the possibility to execute sql statements read from stdin
or from a file. i have so far managed to do so, but every sql statement
must be on a single line with no ";" at the end of each line.
i would like to use an input file like this:
-- file statement.sql --
select * from table
where thing = "something";
------------------------
or
-- file statement.sql --
update table
set image = '<binary data>'
where thing = otherthing;
------------------------
this is how the code looks so far:
// code start
BufferedReader in = new BufferedReader(new FileReader(filename));
while (((statement=in.readLine())!= null) &&(!statement.equals(""))){
try {
ResultSet rset = stmt.executeQuery(statement);
[...]
}
}
// code end
i would like 'statement' to contain the multiline sql statement
including all newlines so that also binary data may be inserted into the
db so i tried to use
System.setProperty("line.separator", ";");
but that didn't help and also doesn't seem the right way for what i want
to achieve. could someone please point me into the right direction on
how to do that? the variety of different stream classes is somewhat
confusing in terms of finding the right class for the right job.
big TIA, armin
--
armin walland
focusmr.com
maculangasse 8
1220 wien
- 6
- Custom eventHello All,
How can I write a custom event?
I want to create a custom event object and fire it at a particular point in
program.
Thanks in advance!
Regards
Suma
- 7
- JDK 1.1.8 V1999-11-9 on recent FBSD 4Hi all,
I tried to run JDK 1.1.8 V1999-11-9 (ELF version) on my FreeBSD
4.8-STABLE box. It could not run and I had the following message:
% java Linpack
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
% java -version
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
% java
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
% jar
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
% java_g
/usr/libexec/ld-elf.so.1: /usr/lib/libm.so.2: Undefined symbol "__stderrp"
Can the JDK 1.1.8 work on recent FBSD 4 and 5?
How can I avoid this problem?
Kazuyuki Shudo email***@***.com http://www.shudo.net/
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 8
- Thread for ProgressBarHi all,
I have a question on threading for the progressbar.
My program will call a few methods and those methods are really time
consuming, the time it takes all depends on how much information are
being pump in, sometimes it can be less than half a minute, sometimes
it can go up to few minutes. So determining the percentage of the
progressbar is impossible.
So how do I find out the total length of the process so that I can
update the progressbar's percentage accordingly?
- 9
- jbutton/jlabel disspearing textHi,
I have created a few JButtons/JLabels but the text on them seems to
disappear depending on the platform the gui is run on (The disappearing text
appears as "..."). How is it possible to set the size of the label/button
according to the length of the text?
Thanks,
Adrien
- 10
- How to solve with aid of Multithreading.. Hi,
Please, could you any one give me the solution for following
problem..
A Dialog box (JDialog) getting input parameters from user..
itself a button attached.. if i click the run
button those parameters are passing to 'C' core which connected by
JNI.. core executing few minutes..
and returning to java.. mean while the dialog box (after
setVisible(false) instuction)
appearing as plain brown box till control return from 'C'..
how can i apply multithreading feature of java's here inorder to
get..
Dialog box should get disappear as soon as button has clicked.
and Percentage of completion should display as in progress bar..
while 'C' running on background..
(or)
Dialog box should get Disappear as soon as button has clicked.
and some processing animation should display till 'C' running on
background...
- 11
- i18n currencyhi all,
i need to internationalize the currency symbol in my application.
please advice on how that can be done
thanks
Chanchal
- 12
- Analytical or IntuitiveI have a test online that measures cognitive style. It determines
whether the participant has an intuitive or analytical learning style.
It takes about 5 minutes.
It's here: http://www.elena.com
I'm a long-time software engineer who's thinking about changing
careers, hence the psychology course. I ended up wanting to study
people like me (not surprising I guess).
I know the sample will be non-probabilistic. So this will be a
quasi-experiment.
Elena
- 13
- Detecting KeyBoard events on a JDialogHello,
i have a JDialog subclass, with a lot of components in it, and i would
like to detect Ctrl+C on it. I've tried to use this:
protected void register(JComponent jcomp) {
Action action = new AbstractAction("Action") {
public void actionPerformed(ActionEvent evt) {
System.err.println("Action!!!");
}
};
KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_C,
KeyEvent.CTRL_DOWN_MASK);
jcomp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(key, "myaction");
jcomp.getInputMap(JComponent.WHEN_FOCUSED).put(key, "myaction");
jcomp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(key,
"myaction");
jcomp.getActionMap().put("myaction", action);
}
wich is call like that:
register((JComponent)getContentPane());
register((JComponent)getGlassPane());
register(getRootPane());
but my action is never performed.
So i've registered a KeyListener recursively on my dialog, and the
keylistener is called with getSource() returning the dialog ref. But the
dialog has no inputMap so how can i do?
I can't use the recursive trick because there are 2 JTables in the
Dialog which must keep its default copy behavior, and a lot of text
fields too.
Thanks for any help.
- 14
- Servlet LDAP Web Server AuthenticationThis may not be the correct place to post this; however, please bear
with me.
Platform: Solaris 9
iPlanet Web Server
Java Servlets/JSP website
I have a servlet that displays the contents of a directory as links
available for downloading/viewing. I have also locked this directory
down using LDAP through the web administration page of iPlanet. What
I would like to happen is to authenticate to the web server first,
before the links are displayed, so that when the user clicks on the
links, they are not prompted with the typical gray box asking for a
username and password. I've researched and implemented JNDI,
authenticated to LDAP, tailed the logs, and I authenticate fine. My
servlet loads, and the first thing it does is query ldap and
authenticate. Next it prints out the page containing the links.
(I've even tried not closing the context) But as soon as I click on
the links, I am prompted again. I am assuming (and very fuzzy on how
this works) that yes, I authenticated to LDAP. But the webserver
doesn't know that. So how do I get the webserver to realize that I've
already authenticated? Any help would be appreciated.
Thanks,
Kim
- 15
- URL.openConnection bug in 1.6??If a bug report I got is correct, under some conditions JDK 1.6
URL.openConnection returns null without throwing an IOException.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
|
|