Problem woth storing data in binary.
Hi,
I have some data which I am storing in binary and when I read it back in, I get different data than that which was stored...I was wondering if anyone could help me out as to what I have done wrong, Below are the 2 Vi's I am using to test this: the first one makes the binary file, the second one reads it back in. Thanks a lot for any help!
Intern NSWCCD Carderock.
Attachments:
Untitled.vi 47 KB
The read vi is actually a bit more complex to modify.
Modifications to "read from SGL file":
Replace the "4" with an "8" for the quotient&remainder division (8bytes/DBL).
Change the "1D array" and "2D array" output to DBL.
Open "Read File +[SGL]"
Change "to Single precision float" to "to double prescision float".
Change the "1D data" and "2D data" arrays to DBL.
Of course you could just use a few low level VIs instead, you probably don't need all that flexibility to read or write a plain DBL 1D array.
LabVIEW Champion . Do more with less code and in less time .
Similar Messages
-
Having problem with storing data in array
Hi,
I'm having problem on storing data in array. My problem is that each time it loops, the array just keep overwrite instead save to the next index. Like at 0 the value is 123, and 1 is 234. But i having that all data capture all overwrite at 0 till the last data it still show at 0. How do i correct this problem?
Solved!
Go to Solution.How to use array to do comparison? Like Array 1 go thru array 2 to get data Loss out and build an array. Like Array 1 ,1000,1024,1048,etc before 1520 fall in between Array 2 range 1000-1500. So Freq 1000,1024,1048 etc will get Loss value as 1 and 1520 fall in between 1500-2000 will output Loss 2. and so on till the end of the list. How should do this? Need help on this.
Array 1 Array 2
Freq Freq Loss
1000 1000 1
1024 1500 2
1048 2000 3
1100 :
1200 :
: 18000
1520
18000 -
I am trying to store my data in binary files to save space and lessen time spent on hard disk reads. However, I can't seem to find the proper way to do this in java.
For example, I have the integer 65535 in java. How do I convert it into a 2 byte string FF FF in java?
When I read 2 bytes FF FF to a string from a binary file, how do I interpret it as a -32767 or a 65535 ?
Sorry if this seems like a really obvious question. None of the integer or string methods in java seems to do what I want :(If all you want is a compressed file, you might want to use java.util.zip.GZIPOutputStream, and send it data in a simple format (like XML) rather than trying to compress everything to bytes yourself.
-
Problem after storing data in Storage and trying to read it
Hi all,
I have a problem with reading the data from a Storage file I created. The code folows:
public var storage: Storage;
public var prop: Property;
public var props: Property[];
var initialized: Boolean = false;
public function initiliazeDatabase(): Boolean {
storage = Storage {
source: "test.db"
var resource: Resource = storage.resource;
var inputStream: InputStream = resource.openInputStream();
readData(inputStream);
println("Initilatization done!!!");
println("size: {sizeof props}");
return initialized;
function initStorage() {
println("Initializing Storage ");
var out = storage.resource.openOutputStream(true);
var dummyRoot = "<prop></prop>\n";
out.write(dummyRoot.getBytes());
out.close();
initialized = true;
function parseCallback(e: Event) {
if (e.type == PullParser.START_ELEMENT) {
if (e.qname.name == "prop" and e.level == 0) {
prop = Property { };
} else if (e.type == PullParser.END_ELEMENT) {
if (e.qname.name == "prop" and e.level == 0) {
insert prop into props;
} else if (e.type == PullParser.TEXT) {
if (e.qname.name == "name" and e.level == 1) {
prop.name = e.text;
if (e.qname.name == "value" and e.level == 1) {
prop.value = e.text;
public function addProp(name: String, value: String): Void {
prop = Property {
name: name;
value: value;
insert prop into props;
public function storeData(): Void {
var out = storage.resource.openOutputStream(false);
for (prop in props) {
out.write(prop.toXml().getBytes());
out.close();
public function readData(inn: InputStream): Void {
var parser = PullParser {
input: inn;
onEvent: parseCallback;
try {
parser.parse();
initialized = true;
} catch (npe: NullPointerException) {
initStorage();
Now, for the first time, the app works as it should, the Storage is initialized (if it does not exist) and the required fields are stored in it when I need to.
However, the next time I start the application I get the following error:
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.runtime.provider.GUIRuntimeProvider$1.run(GUIRuntimeProvider.java:65)
at com.sun.javafx.tk.swing.SwingToolkit$StartupRoutine.run(SwingToolkit.fx:582)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: com.sun.javafx.data.pull.impl.StreamException: [20,1] Syntax Error in prop
at com.sun.javafx.data.pull.ukit.xml.ParserStAX.panic(ParserStAX.java:1516)
at com.sun.javafx.data.pull.ukit.xml.ParserStAX.next(ParserStAX.java:400)
at javafx.data.pull.PullParser.next(PullParser.fx:319)
at javafx.data.pull.PullParser.parse(PullParser.fx:258)
at com.gpsbuddy.utils.DatabaseUtils.readData(DatabaseUtils.fx:86)
at com.gpsbuddy.utils.DatabaseUtils.readData(DatabaseUtils.fx:86)
at com.gpsbuddy.utils.DatabaseUtils.initiliazeDatabase(DatabaseUtils.fx:30)
at com.gpsbuddy.utils.DatabaseUtils.initiliazeDatabase(DatabaseUtils.fx:30)
at com.gpsbuddy.main.Main.<clinit>(Main.fx:21)
at com.gpsbuddy.main.Main.<clinit>(Main.fx:21)
I did check the muffin file and it has no errors in it...
Thanks in andvance...Well, as it appears, the second part of the exception was right.. :P... I do have problem with the XML file.. for some reason I cannot have two <prop> tags in one document?
For example, if I have <prop></prop>, the program start ok... but when a new prop is added, for example, <prop></prop><prop></prop>, I get the error from the previous post?
Does anybody know anything about this? Could this be an error in the parser, or I am missing something?
Edited by: jonycus1 on Feb 25, 2010 3:10 PM -
JNDI : connection problem while storing data more than one records
I am persisting data into the MSSQL Server 2005 database using the JNDI lookup. I can insert the single record at a time, but when I ran the test program for 10 or 20 records i am getting the following exception on Jboss
Configuration details : JBoss, Spring, MSSQL server 2005, Jdk 5
JNDI mapping from JBOSS
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/myjndi</jndi-name>
<!-- allows DS to be accessed remotely -->
<use-java-context>false</use-java-context>
<connection-url>jdbc:inetdae7:localhost:1434?database=myDB&secureLevel=0</connection-url>
<driver-class>com.inet.tds.TdsDriver</driver-class>
<user-name>sa</user-name>
<password>admin123</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>50</max-pool-size>
<metadata>
<type-mapping>MS SQLSERVER2000</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
Exception :
14:07:06,812 INFO [myMDB] Exception while Storing Event in Database : Could not get JDBC Connection; nested exception is org.jboss.util.Neste
dSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset); - neste
d throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.S
ocketException: Connection reset))
14:07:06,812 INFO [STDOUT] org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava
.net.SocketException: Connection reset); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (co
m.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset))
14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:107)
14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:112)
14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:177)
14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:356)
14:07:06,812 INFO [STDOUT] at com.org.project.gen.MyDAOImpl.insert(MyDAOImpl.java:25)
14:07:06,812 INFO [STDOUT] at com.org.project.geo.MyTabletDAO.addEvent(MyTabletDAO.java:137)
14:07:06,812 INFO [STDOUT] at com.org.project.mdb.myMDB.onMessage(myMDB.java:72)
14:07:06,812 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
14:07:06,812 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:07:06,812 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
14:07:06,812 INFO [STDOUT] at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:87)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:873)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1090)
14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1392)
14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._submit(TibjmsSession.java:3567)
14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._dispatchAsyncMessage(TibjmsSession.java:1963)
14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._run(TibjmsSession.java:3054)
14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession.run(TibjmsSession.java:4204)
14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
14:07:06,812 INFO [STDOUT] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
14:07:06,812 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
14:07:06,812 INFO [STDOUT] Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.
SocketExceptionjava.net.SocketException: Connection reset)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
java:161)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnection
Pool.java:508)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534
14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:395)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:297)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:447)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManage
r2.java:874)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:103)
14:07:06,812 INFO [STDOUT] ... 33 more
14:07:06,812 INFO [STDOUT] Caused by: com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset
14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createSQLException(Unknown Source)
14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.<init>(Unknown Source)
14:07:06,812 INFO [STDOUT] at com.inet.tds.q.<init>(Unknown Source)
14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createConnection(Unknown Source)
14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsDriver.connect(Unknown Source)
14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
java:151)
14:07:06,812 INFO [STDOUT] ... 41 moreHi Subin,
You can try couple of things.
If your data is less than 32767, you can pass it to stored procedure and change it to clob type like
PROCEDURE CLOBQUERY
Param IN CLOB,
and you can call Procedure
EXECUTE CLOBQUERY '[Param.1]'
If your data is around than 1000000(32767*32), you can break the data in length of 32767 and pass it to param 1 to 32 like
EXECUTE CLOBQUERY '[Param.1][Param.2][Param.3]..[Param.32]'
Finally you can try to update jdbc drive.
check the link Link: [JDBC Limitation|http://confluence.atlassian.com/display/JIRA/UsingOracle10gdriverstosolvethe4000character+limitation] -
Problem in storing date & Time value
How to store the Date & time value in 1 textfield only.In my case i am selectecting The Time from two LOV's (HH & MM),then Date value is selecting from simple i/ptext,
I want to store the (Date+HH+MM) in the date field.......
code is....
public String CalculationM() {
BindingContainer bindings = getBindings();
DCIteratorBinding dcIterBinding = (DCIteratorBinding)bindings.get("Timeview1Iterator");
RowSetIterator row= dcIterBinding.getLovRowSetIterator();
String i=selectOneChoice5.getValue().toString();
int index=Integer.parseInt(i);
int index2=index+1;
Row r= row.getRowAtRangeIndex(index2);
String val=r.getAttribute("Hour").toString();
String i1=selectOneChoice6.getValue().toString();
// System.out.println("HH index="+index2+" MM index is="+i1);
int index1=Integer.parseInt(i1);
int index3=index1+1;
Row r1=row.getRowAtRangeIndex(index3);
String val1=r1.getAttribute("Minutes").toString();
int valint=Integer.parseInt(val);
String valnew;
if(valint<=12)
{ if(valint==12)
valnew=val+":"+val1+":"+"PM";
else
valnew=val+":"+val1+":"+"AM";
else
val=String.valueOf((valint-12));
valnew=val+":"+val1+":"+"PM";
valnew=val+val1;
String Dateis= inputText4.getValue().toString();
String Date1=Dateis+" "+valnew;
System.out.println("TOTAl Date Is="+Date1);
try
{ SimpleDateFormat sdf = new SimpleDateFormat("dd:MM:yyyy hh:mm");
java.util.Date date = sdf.parse(Date1);
java.sql.Date sqlDate = new java.sql.Date(date.getTime());
oracle.jbo.domain.Date ojdd = new oracle.jbo.domain.Date(sqlDate);
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
DCBindingContainer binding = (DCBindingContainer) app.getVariableResolver().resolveVariable(context, "bindings");
binding.findIteratorBinding("AppointDetView1Iterator").getCurrentRow().setAttribute(7,ojdd);
catch(ParseException e)
System.out.println("Error is:"+e.toString());
OperationBinding operationBinding =bindings.getOperationBinding("Commit");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
return null;
But i am getting error ....the Time is not storing in Date field bt the Time which we r giving with the Date field is storing.......
My Date Attribute has Date format as dd-MM-yyyy hh:mm:aa
If i changed it to dd-MM-yyyy then .... The value "12-3-2008" is not a valid date. Valid example: "29-11-2005 ".this error is getting
Error
- Not a date.
Plz help me in this case ...wil be very thankful for ur help.........actually i am inputting the value 12-03-2008 but i am getting tha error which i hav told before....
plz reply me....
Message was edited by:
user553181 -
Problem in storing data through TOMCAT6.0
hi friends i using TOMCAT6.0 and sql sever iam trying to store data but iam getting a below error kindly please rectify me asap thank a lot
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 23 in the jsp file: /rajkumar/try2.jsp
Syntax error on tokens, delete these tokens
20: stmt = conn.createStatement();
21: out.println("statement Executed");
22: result = stmt.executeQuery("SELECT * FROM pur");
23: stmt.executeUpdate("Insert into pur(name,pno,age) values("kumar","342","32")");
24: out.println("result");
25:
26: }
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.
Apache Tomcat/6.0.10program
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<html>
<head>
<title>Obtaining a Connection</title>
</head>
<body>
<%
Connection conn = null;
ResultSet result = null;
Statement stmt = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
out.println("statement executed");
conn = DriverManager.getConnection("jdbc:odbc:sample","sa","pwd");
out.println("Statement 2 Executed");
stmt = conn.createStatement();
out.println("statement Executed");
result = stmt.executeQuery("SELECT * FROM pur");
stmt.executeUpdate("Insert into pur(name,pno,age) values("kumar","342","32")");
out.println("result");
catch (SQLException e) {
System.out.println(e.getMessage());
%>
</body>
</html>
The problem you posted was "Unable to compile class for JSP" which is nothing to do with establishing a connection.
If you now have a different problem, please post the whole error message.
Assuming this really is a new problem, have you checked to make sure that the DSN called "sample" really exists and that it can be used to connect to the database. You should also make sure that it's set up for the appropriate user account if Tomcat is running as a service. -
Problem in storing data in BAPI in File to RFC Scenario
Hi everyone,
I m doing File to RFC Scenario.......I completed design and configuration part and actived the Communication Channels.....
Now when I check in Runtime workbench I am getting succefully executed both at outbound and Inbound Channels.......but
data is not updated in BAPI...........
I m getting following error when I check in Component monitoring......
Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: RfcAdapter: receiver channel has static errors: configuration exception caused by: com.sap.aii.af.rfc.core.config.RfcChannelInactiveException: channel has status inactive: com.sap.aii.af.rfc.afcommunication.RfcAFWException: RfcAdapter: receiver channel has static errors: configuration exception caused by: com.sap.aii.af.rfc.core.config.RfcChannelInactiveException: channel has status inactive
Please help me out.......
Regards,
Sudheer.Hi
"I took Business Service as Service but not Business System.....Will it effect the scenario???......"
I suggest While dealing with the SAP Systems we should use Business systems.
Pls check the foolowing Threads for the above Query
RFC - Business Service
Re: business service for file to rfc
Regards
Abhijit -
Problem in storing date in the access table
But I am not able to insert this date in the table of
Msacess database using the sql statement insert into.
When sysdate is inserted I get the error message
"Data type mismatch".
Statement st1 = con.createStatement();
st1.executeUpdate("insert into order1 values ('"+sysdate+"')");
I declared the field of ms access table as Date/Time.
What I should do to store sysdate in the table.
Please help me.
My thanks in advance.Use This Query it will work bu using #
Statement st1 = con.createStatement();
st1.executeUpdate("insert into order1 values (#'"+sysdate+"#')"); -
Problem in storing JAPANESE character in DB 10g
All,
I have problem in storing data in Db.
I used page directive in JSP like
<%@ page contentType="text/html; charset=iso-2022-jp"%>
in jsp screen in will get JAPANESE character but in DB I found some JUNK but reteriving the same in jsp it shows correct JAPANESE character...
Any one help me please.
I used Hibernate
Thanks and Regards
BabuYou have probably posted in the wrong forum. Try the JDeveloper forum: JDeveloper and ADF
-
Problem in storing JAPANESE character in DB 10g charset iso-2022-jp
All,
I have problem in storing data in Db.
I used page directive in JSP like
<%@ page contentType="text/html; charset=iso-2022-jp"%>
in jsp screen in will get JAPANESE character but in DB I found some JUNK but reteriving the same in jsp it shows correct JAPANESE character...
Any one help me please.
I used Hibernate
Thanks and Regards
BabuHai John..Thanks for ur reply.
In DB NLS_CHARACTERSET is JA16SJIS.
Want to change it?
Please guide me.
Thanks in advance.
Babu -
Stored Procedure w/ binary data parameter problems in Visual Basic
Howdy all.
I am having a problem calling stored procedures with a BLOB parameter. I have tried changing the paramater other data types to see if it would work, but with no success. I am calling the stored procedure from Visual Basic using ADO. I am using the Oracle ODBC Driver, Release 9.2.0.4.0. I have tried changing the setup of the ODBC a good bit because that has fixed several problems for me in the past; however, it did not fix my current problem.
Here is what I am trying to do. I have a function like the folowing:
<BEGIN --------------------------------------->
CREATE OR REPLACE FUNCTION PAGEFORMATSINSERT(
p_ObjectFormatCode_ID IN RAW DEFAULT NULL,
p_PA_ID IN RAW DEFAULT NULL,
p_Name IN VARCHAR2 DEFAULT NULL,
p_FormatData IN BLOB DEFAULT NULL,
p_PF_ID IN OUT RAW )
RETURN INTEGER
AS
BEGIN
INSERT INTO PAGEFORMATS (PF_ID, ObjectFormatCode_ID, PA_ID, Name, FormatData) /* <---- this FormatData column is a BLOB column */
VALUES (p_PF_ID, p_ObjectFormatCode_ID, p_PA_ID, p_Name, p_FormatData)
END PAGEFORMATSINSERT;
<END ----------------------------------------->
The FormatData parameter has a data type of BLOB. In my Visual Basic, I have my ADODB.Command object. I am setting the CommandText of the Command object to "{? = call PageFormatsInsert(?, ?, ?, ?, ?)}". In order to set the parameter value for the BLOB data type, I am calling the AppendChunk function of the Command object - passing it a Byte array.
I am getting the folling error:
ERROR: -2147467259 [Oracle][ODBC][Ora]ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'PAGEFORMATSINSERT'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
If I change the FormatData parameter to a LONG RAW parameter, I get the following error:
ERROR: -2147467259 [Oracle][ODBC][Ora]ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error
ORA-06512: at line 1
I am at a loss as to how to get binary data into by Oracle database. I need to do it using stored procedures. How can I set up my stored procedure or table to do what I want it to do? Should I change my table definition? Are there some settings in the ODBC connection I can tweak? How can I get the stored procedure to accept my call from VB ADO?
Any help would be appreciated.
wallyThanks for the idea, but I don't get how I am supposed to get my binary data to the stored procedure using the stream. I have a binary array that I want to pass to a stored procedure. I want to be able to use the same Visual Basic front end with out MSSQL database as with our Oracle database.
I am using the ADODB Connection and Command and RecordSet objects. Currenlty our front end calls the ADODB.Command(ParamNumber).AppendChunk function passing it the binary array. Somehow, the SQL Server driver does the magic in order for the MSSQL stored procedure to work correctly. I need to know how to do one of the following:
1. Get the Oracle driver to do the same magic.
2. Set up the Oracle stored procedure so I don't have to change the VB front end.
3. Change the VB front end so that it works with both MSSQL and Oracle.
wally -
Problem storing date in MS Access using JSP
Hi all,
Can anyone please help me storing date in MS Access using Java i am getting errors. I think it is probably because MS Access take "date/month". I am entering a string with date and month example
1st October as "0110". I don't know how to enter a date in MS Access.
Here is my code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@page import="java.io.*"%>
<%@page import="java.sql.*"%>
<HTML>
<HEAD>
<TITLE> </TITLE>
</HEAD>
<BODY>
<%
String emplno = request.getParameter("emplno");
String date = request.getParameter("date");
String proposal = request.getParameter("proposals");
String network1 = request.getParameter("network");
String suppassociates = request.getParameter("suppasso");
String intmngt = request.getParameter("intmgt");
String client[] = request.getParameterValues("client");
String client1= request.getParameter("client1");
String clientunit[] = request.getParameterValues("clientunit");
String clientunit1=request.getParameter("clientunit1");
int staffid = Integer.parseInt(emplno);
double proposalunit=Double.parseDouble(proposal);
double suppliersunit=Double.parseDouble(suppassociates);
double networkunit=Double.parseDouble(network1);
double internalmgtunit=Double.parseDouble(intmngt);
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
Connection con = DriverManager.getConnection("jdbc:odbc:finalmp" );
String activities= "INSERT INTO StaffActivities (StaffID,Date,ProposalUnit,NetworkingUnit,SuppliersAssociatesUnit,InternalMGTUnit) VALUES (?,?,?,?,?,?)";
PreparedStatement pstmt = con.prepareStatement(activities);
pstmt.setInt(1,staffid);
pstmt.setString(2,date);
pstmt.setDouble(3,proposalunit);
pstmt.setDouble(4,suppliersunit);
pstmt.setDouble(5,networkunit);
pstmt.setDouble(6,internammgtunit);
pstmt.executeUpdate();
//String emplno="hello";
//String entered_date="hello";
//int access_date=0;
//int user_date=0;
if(pstmt!=null)
pstmt.close();
if(con!=null)
con.close();
%>
</BODY>
</HTML>i hope this can help you
public static String convertToISOFormat(Date dateTime) {
// ISO Format: 'YYYY-MM-DD HH:MM:SS'
String returnValue = fillLeft(String.valueOf(dateTime.getYear()+1900), 4,
'0')
+ "-"
+ fillLeft(String.valueOf(dateTime.getMonth()+1), 2, '0')
+ "-"
+ fillLeft(String.valueOf(dateTime.getDate()), 2, '0')
+ " "
+ fillLeft(String.valueOf(dateTime.getHours()), 2, '0')
+ ":"
+ fillLeft(String.valueOf(dateTime.getMinutes()), 2, '0')
+ ":" + fillLeft(String.valueOf(dateTime.getSeconds()), 2, '0');
return returnValue;
} -
InvokeAll on off-heap stored data
I'm using a distributed cache with partitioned off-heap storage because all the data can't be contained in the heap memory. However, profiling the heap memory still show the storage worker threads still have enormous amounts of data in memory even after GC's.
So that's why I was wondering what happens, when you do something like
myCache.invokeAll(new EqualsFilter("someProperty", "someValue"), new MyEntryProcessor());and there's no index on "someProperty".
When the storage containing node receives the invocation request, it must get all stored data from off-heap memory to heap memory to filter it and optionally apply the EP to it.
How does it do that? Does it end up loading all data in heap memory? The filtered and unfiltered ones? Or is the processing done entry per entry only keeping a reference to the entry being filtered and processed by the EP?
I'm using Coherence 3.5.3 patch5.
Regards
Jan
Edited by: user10601659 on Oct 12, 2010 6:59 AMHi Jan,
user10601659 wrote:
Hi Robert,
so what you're saying is that suppose I have 1000 objects in the cache and 500 of them match my filter, those 500 objects need to fit in my heap space when I do cache.invokeAll(Filter, EntryProcessor).
Potentially all 500 may need to fit (e.g. if they are in the same partition). Also, I suspect, besides the Java form, the Binary version of the object also will need additional capacity while you are executing the processAll method.
If this holds true, wouldn't it be a workaround to use a PartitionedFilter or a LimitFilter and invoke the EntryProcessor per partition or per #objects? This way the number of matching objects can be reduced.
Regards
JanYou can use PartitionedFilter or LimitFilter or whatever approach to break down data processed at the same time to more manageable chunks. The main problem with this multiple roundtrip approach is that cached data may change between getting the individual chunks, so you get weaker consistency across those chunks. (Data in individual chunks will not necessarily be consistent with each other). Whether this is a problem for you or not, is something which only you can decide. Whatever you do, cross partition guarantees may not be provided anyway, but if chunking only by numbers, you may lose consistency for data residing within a single partition, too.
Best regards,
Robert
Edited by: robvarga on Oct 13, 2010 2:19 PM -
SAP paging overflow when storing data in the ABAP/4 memory.
I am trying to create a data source in BI7.0 in the Datawarehousing Workbench. But along the process when i need to select a view i get an error detailed in the following error file extract: Please go through and assist.
untime Errors MEMORY_NO_MORE_PAGING
Date and Time 06.06.2009 14:21:35
Short text
SAP paging overflow when storing data in the ABAP/4 memory.
What happened?
The current program requested storage space from the SAP paging area,
but this request could not be fulfilled.
of this area in the SAP system profile.
What can you do?
Note which actions and input led to the error.
For further help in handling the problem, contact your SAP administrator
You can use the ABAP dump analysis transaction ST22 to view and manage
termination messages, in particular for long term reference.
Error analysis
The ABAP/4 runtime system and the ABAP/4 compiler use a common
interface to store different types of data in different parts of
the SAP paging area. This data includes the
ABAP/4 memory (EXPORT TO MEMORY), the SUBMIT REPORT parameters,
CALL DIALOG and CALL TRANSACTION USING, as well as internally defined
macros (specified with DEFINE).
To store further data in the SAP paging area, you attempted to
allocate a new SAP paging block, but no more blocks were
available.
When the SAP paging overflow occurred, the ABAP/4 memory contained
entries for 20 of different IDs.
Please note:
To facilitate error handling, the ABAP/4 memory was
deleted.
How to correct the error
The amount of storage space (in bytes) filled at termination time was:
Roll area...................... 8176
Extended memory (EM)........... 13587912
Assigned memory (HEAP)......... 0
Short area..................... " "
Paging area.................... 40960
Maximum address space.......... " "
By calling Transaction SM04 and choosing 'Goto' -> 'Block list',
you can display an overview of the current roll and paging memory
levels resulting from active users and their transactions. Try to
decide from this whether another program requires a lot of memory
space (perhaps too much).
The system log contains more detailed information about the
termination. Check for any unwanted recursion.
Determine whether the error also occurs with small volumes of
data. Check the profile (parameter "rdisp/PG_MAXFS", see
Installation Guidelines).
Is the disk or the file system that contains the paging file
full to the extent that it cannot be increased, although it has
not yet reached the size defined in the profile? Is the
operating system configured to accommodate files of such a
size?
The ABAP processor stores different types of data in the SAP
paging area. These include:
(1) Data clusters (EXPORT ... TO MEMORY ...)
(2) Parameters for calling programs (SUBMIT REPORT ...),
Dialog modules (CALL DIALOG ...) and transactions
(CALL TRANSACTION USING ...)
(3) Internally defined program macros (DEFINE ...)
Accordingly, you should check the relevant statements in a program
that results in an overflow of the SAP paging area.
It is critical when many internal tables, possibly with
different IDs, are written to memory (EXPORT).
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"MEMORY_NO_MORE_PAGING" " "
"SAPLWDTM" or "LWDTMU20"
"TABC_ACTIVATE_AND_UPDATE"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.Hi Huggins,
Maintenance of the Paging File is owned by your basis team.
They should increase this in order for your transaction to process successfully.
Just for your reference, in case the OS used is windows server 2003, paging file value can be checked through;
Right click in the My Computer>properties.
Then go to Advance tab;
Then there should be a performance section, click the settings
Then Advance tab again. The paging file can be seen from there.
(and can be adjusted from there also)
The value of the paging file in general will be dependent with the available RAM from the hardware.
Hope this helps. Thanks a lot.
- Jeff
Maybe you are looking for
-
Pop-up Menu in Numbers unwrap and display in next column
I'm creating a row which will contain consecutive pop-up menus. The text is large for the cell (on purpose) but I'm hoping that the text can rollover into the next cell, but it won't do it. I've formatted the cell NOT to wrap, but it is hiding under
-
Not able to use a function inside a sql in a form, Why ??
Here SERIAL_NUM is a function, this sql work fine in TOAD and SQLPLUS but inside the form iam getting error saying "function serial_num cannot be used in a sql" Why is it like that ?? Is there anyother way to execute this sql ? cursor c1 is SELECT ms
-
Just Black movies in iDVD playback
Hello. I bought myself a Casio Exilim S770 and Import the mpeg4 avi files to idvd. But there I just see some black movies but can hear the original sound. In QT the playback runs normal. Also in VLC. Another strange thing is, that if i copy some of t
-
Ok, I am confused as I am reading here that Nokia do not provide these codes and they come direct from the manufacturer. Please see my thread on Boards.ie: http://www.boards.ie/ttfthread/2057018326/2 where a verified Vodafone rep says that they need
-
Starting a few weeks ago I got a cluster of blue and black lines at the bottom righthand corner of my screen. It was frustrating and annoying but I ignored it. Now there is another one closer to the top lefthand side. It's very frustrating as this co