Help needed to loadjava apache poi jars into oracle database.
Help needed to loadjava apache poi jars into oracle database. Many classes left unresolved. (Poi 3.7, database 11.1.0.7). Please share your experience!
Hi,
The first 3 steps are just perfect.
But with
loadjava.bat -user=user/pw@connstr -force -resolve geronimo-stax-api_1.0_spec-1.0.jar
the results are rather unexpected. Here is a part of the log file:
arguments: '-user' 'ccc/***@bisera7-db.dev.srv' '-fileout' 'c:\temp\load4.log' '-force' '-resolve' '-jarsasdbobjects' '-v' 'geronimo-stax-api_1.0_spec-1.0.jar'
The following operations failed
resource META-INF/MANIFEST.MF: creation (createFailed)
class javax/xml/stream/EventFilter: resolution
class javax/xml/stream/events/Attribute: resolution
class javax/xml/stream/events/Characters: resolution
class javax/xml/stream/events/Comment: resolution
class javax/xml/stream/events/DTD: resolution
class javax/xml/stream/events/EndDocument: resolution
class javax/xml/stream/events/EndElement: resolution
class javax/xml/stream/events/EntityDeclaration: resolution
class javax/xml/stream/events/EntityReference: resolution
class javax/xml/stream/events/Namespace: resolution
class javax/xml/stream/events/NotationDeclaration: resolution
class javax/xml/stream/events/ProcessingInstruction: resolution
class javax/xml/stream/events/StartDocument: resolution
class javax/xml/stream/events/StartElement: resolution
class javax/xml/stream/events/XMLEvent: resolution
class javax/xml/stream/StreamFilter: resolution
class javax/xml/stream/util/EventReaderDelegate: resolution
class javax/xml/stream/util/StreamReaderDelegate: resolution
class javax/xml/stream/util/XMLEventAllocator: resolution
class javax/xml/stream/util/XMLEventConsumer: resolution
class javax/xml/stream/XMLEventFactory: resolution
class javax/xml/stream/XMLEventReader: resolution
class javax/xml/stream/XMLEventWriter: resolution
class javax/xml/stream/XMLInputFactory: resolution
class javax/xml/stream/XMLOutputFactory: resolution
class javax/xml/stream/XMLStreamReader: resolution
resource META-INF/LICENSE.txt: creation (createFailed)
resource META-INF/NOTICE.txt: creation (createFailed)
It seems to me that the root of the problem is the error:
ORA-29521: referenced name javax/xml/namespace/QName could not be found
This class exists in the SYS schema though and is valid. If SYS should be included as a resolver? How to solve this problem?
Similar Messages
-
How to insert a image file into oracle database
hi all
can anyone guide me how to insert a image file into oracle database now
i have created table using
create table imagestore(image blob);
but when inserting i totally lost don't know what to do how to write query to insert image fileHi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
out.println(" <input type='submit' name='submit' value='Submit' class='smalltext'>");
out.println("</form>"); Import this once you have the jar file:
import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
boolean result = true;
String fileName = null;
byte fileData[] = null;
String fileUploadError = null;
String imageType = "";
String error = "";
DiskFileUpload fb = new DiskFileUpload();
List fileItems = fb.parseRequest(request);
Iterator it = fileItems.iterator();
while(it.hasNext()){
FileItem fileItem = (FileItem)it.next();
if (!fileItem.isFormField()) {
fileName = fileItem.getName();
fileData = fileItem.get();
// Get the imageType from the filename extension
if (fileName != null) {
int dotPos = fileName.indexOf('.');
if (dotPos >= 0 && dotPos != fileName.length()-1) {
imageType = fileName.substring(dotPos+1).toLowerCase();
if (imageType.equals("jpg")) {
imageType = "jpeg";
String filePath = request.getParameter("FILE_PATH");
session.setAttribute("filePath", filePath);
session.setAttribute("fileData", fileData);
session.setAttribute("fileName", fileName);
session.setAttribute("imageType", imageType);
return result;
} And now finally the method to actually write the file to the database:
private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
//If the previous code found a file that can be uploaded then
//save it into the database via a pstmt
String sql = "";
UtilDBquery udbq = getUser(request).connectToDatabase();
Connection con = null;
int signatureID = 0;
PreparedStatement pstmt = null;
try {
udbq.setUsePreparedStatements(true);
con = udbq.getPooledConnection();
con.setAutoCommit(false);
if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
pstmt = con.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
while(rs.next()) {
signatureID = rs.getInt(1);
if (fileName != null && imageType != null) {
sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
InputStream is2 = new ByteArrayInputStream(fileData);
pstmt = con.prepareStatement(sql);
pstmt.setInt(1, signatureID);
pstmt.setBinaryStream(2, is2, (int)(fileData.length));
pstmt.executeUpdate();
pstmt.close();
con.commit();
con = null;
if(mode.equals("U") && signatureIDIn != 0) {
signatureID = signatureIDIn.intValue();
if (fileName != null && imageType != null) {
sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
InputStream is2 = new ByteArrayInputStream(fileData);
pstmt = con.prepareStatement(sql);
pstmt.setBinaryStream(1, is2, (int)(fileData.length));
pstmt.setInt(2, signatureID);
pstmt.executeUpdate();
pstmt.close();
con.commit();
con = null;
} catch (Exception e) {
con = null;
throw new Exception(e.toString());
return signatureID;
} -
Regarding loading of excel data into oracle database
hello,
Can someone help me in knowing that how can we load excel sheets data into oracle database.
I will be really thankful to you.
GursimranHi,
There is tool given by oracle "Oracle Bulk Loader "
you can use this.
But in order use this you need a control file, which specifies how data should be loaded into the database; and a data file, which specifies what data should be loaded.
Example :- this is the control file which has information how the data is processed.
LOAD DATA
INFILE test.dat
INTO TABLE test
FIELDS TERMINATED BY '|'
(i, s)
Example :- test.dat which is the data file or say your excel sheet or document
(1, 'foo')
(2, 'bar')
(3, ' baz')
example of Loading :-
sqlldr <yourName> control=<ctlFile> log=<logFile> bad=<badFile>
sqlldr testing control=test.ctl log=test.log
Thanks
Pavan Kumar N -
Read data from Excel and write into oracle database
Hi
I want to know how can i read data from excel and write into oracle database using java.Kindly help me out to find a solution.
Thanks and Regards
NeetaHai,
I am suggesting the solution.
I will try out and let u know soon.
Make a coma separated file from your excel file.
Assuming that your requirement allows to make a csv file.
This file may be passed as an file object to be read by java.Using JDBC you must be able to populate the data base.You can also use String Tokenizer if needed.
You do not want to go via sql Loader?
For reading the excel file itself do you want java? -
Uploading Data from a Flat file into Oracle Database
Hi,
I am a novice to Java . SO, please bear with me. I have a reqiurement where I have a flat file or excel file from which I need to read the data and insert into Oracle Database. The falt file will exist on the client machine. I have been reading and I see this can be done through I/O Streams. Correct me if I am wrong. I am looking for a sample code to get started. Any Java expert has an answer for it, I will appreciate it.
ThanksTry UploadBean. It allows to upload files (from a browser) in Oracle.
http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html
You will find JSP and servlet samples. -
Convert flat file to XML document and store into Oracle database
First:
I have a flatfile and created external table to read that file in Oracle
Now I want to create an XML document for each row and insert into Oracle database, I think that XMLtype.
Could you please provide me some information/steps.
Second:
Is there performance issues, because everyday I need to check that XML document stored in the database against the in coming file.
Thank You.Oracle 11g R2 Sun Solaris
Flat file is | (pipe delimited), so I did create an EXTERNAL Table
row1 a|1|2|3|4
row2 b|2|3|4|5
row3 c|6|7|8|9
I want to store each record as XML document. So it will be easy to compare with next day's load and make insert or update.
The reason is:
First day the file comes with 5 columns
after some days, the file may carry on some additional columns more than 5
In this case I do not want to alter table to capture those values, if I use XML than I can capture any number of columns, CORRECT!. Please make me correct If I am wrong.
This is the only reason to try to use the XMLType (XML Document)
On Everyday load we will be matching these XML documents and update it if there is any column's value changes
daily average load will be 10 millions and initial setup will be 60-80 millions
Do I have anyother option to capture the new values without altering the table.
Please advise!. -
Issue of inserting greek characters into Oracle database using ICAN505
Hi All,
We are currently facing an issue of inserting greek characters into Oracle database using ICAN505.
We receive a file containing greek characters.The values from the file should be inserted into the database.We are reading the file using file OTD with default encoding.
The file can contain english characters too other than greek characters.
The database NLS_CHARACTERSET is AL32UTF8.
When I insert using an insert statement directly ,the values get inserted properly into the DB table.
Inserting the same values using code results in improper characters getting inserted into the table in the database.
Please help....
Thanks in advance !!Globalization forum?
Globalization Support
It works for SQL Developer, which does not depend on NLS_LANG, so I suspect a problem with your NLS settings. -
Load XML file into oracle database
Hi
i have a xml file and the XSD(Schema definition file for XML). i need to load the xml file into the database.
Can you please tell me the best approach for this ?There are plenty of examples of this on the XML DB Forum.
Here is a link to the FAQ for that forum...
XML DB FAQ -
Insert date time into oracle database from jsp
pls tell me ,from jsp how can I insert datetime values into oracle database .I am using oracle 9i .here is codethat i have tried
html--code
<select name="date">
<option selected>dd</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<select name="month">
<option selected>dd</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<select name="year">
<option selected>dd</option>
<option>2004</option>
<option>2005</option>
<option>2006</option>
<option>2007</option>
</select>
here the jsp code
<% date= request.getParameter("date"); %>
<% month= request.getParameter("month"); %>
<% year= request.getParameter("year"); %>
try
{ Class.forName("oracle.jdbc.driver.OracleDriver"); }
catch (ClassNotFoundException exception)
try
Connection connection = null;
out.println("connectiong the database");
connection = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:orcsid","scott","tiger");
out.println("connection getted");
int rows = 0;
String query_2 = "insert into mrdetails values(?)";
String dob = date+month+year;
prepstat = connection.prepareStatement(query_2);
prepstat.setTimestamp(4,dob);
rows = prepstat.executeUpdate();
out.println("data updated");
catch (Exception exception3)
out.println("Exception raised"+exception3.toString());
}To insert date values into a database, you should use java.sql.Date. If it also has a time component, then java.sql.TimeStamp.
Your use of prepared statements is good.
You just need to convert the parameters into a date.
One way to do this is using java.text.SimpleDateFormat.
int rows = 0;
String query_2 = "insert into mrdetails values(?)";
String dob = date+"/" + month+ "/" + year;
SimpleDateFormat sdf = new SImpleDateFormat("dd/MM/yyyy");
java.util.Date javaDate = sdf.parse(dob);
java.sql.Date sqlDate = new java.sql.Date(javaDate .getTime);
prepstat = connection.prepareStatement(query_2);
prepstat.setTimestamp(4,sqlDate);
rows = prepstat.executeUpdate();
out.println("data updated");Cheers,
evnafets -
Convhow to erting MySQL database into oracle Database
Hi,
how to import/convert MySQL database/tables into oracle database/table.
i need SQL code or any import wizard technique.
ThnxzPlease refer:
http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html -
How to develope application for converting excel data into oracle database
I am very new to the oracle world. I want to develop application for converting excel sheet into oracle database using oracle forms. I have basic knowldge of oracle but i am totally new to the forms. Can anybody tel me step by step procedure to do this task? Please help me out in this problem.
Thanx in advance.Hello,
just do a "Search" in this forum with words "excell to oracle"... and you could find lot of posts about that, i.e.:
Re: How to load excel-csv file into oracle database
Jose L -
How to load excel-csv file into oracle database
Hi
I wanted to load excel file with csv extension(named as trial.csv) into
oracle database table(named as dept),I have given below my experiment here.
I am getting the following error,how should I rectify this?
For ID column I have defined as number(5) datatype, in my control file I have defined as interger external(5),where as in the Error log file why the datatype for ID column is comming as character?
1)my oracle database table is
SQL> desc dept;
Name Null? Type
ID NUMBER(5)
DNAME CHAR(20)
2)my data file is(trial.csv)
ID DNAME
11 production
22 purchase
33 inspection
3)my control file is(trial.ctl)
LOAD DATA
INFILE 'trial.csv'
BADFILE 'trial.bad'
DISCARDFILE 'trial.dsc'
APPEND
INTO TABLE dept
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(ID POSITION(1:5) INTEGER EXTERNAL(5)
NULLIF ID=BLANKS,
DNAME POSITION(6:25) CHAR
NULLIF DNAME=BLANKS
3)my syntax on cmd prompt is
c:\>sqlldr scott/tiger@xxx control=trial.ctl direct=true;
Load completed - logical record count 21.
4)my log file error message is
Column Name Position Len Term Encl Datatype
ID 1:5 5 , O(") CHARACTER
NULL if ID = BLANKS
DNAME 6:25 20 , O(") CHARACTER
NULL if DNAME = BLANKS
Record 1: Rejected - Error on table DEPT, column ID.
ORA-01722: invalid number
Record 21: Rejected - Error on table DEPT, column ID.
ORA-01722: invalid number
Table DEPT:
0 Rows successfully loaded.
21 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Bind array size not used in direct path.
Column array rows : 5000
Stream buffer bytes: 256000
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 21
Total logical records rejected: 21
Total logical records discarded: 0
Total stream buffers loaded by SQL*Loader main thread: 0
Total stream buffers loaded by SQL*Loader load thread: 0
5)Result
SQL> select * from dept;
no rows selected
by
balamuralikrishnan.sHi everyone!
The following are the steps to load a excell sheet to oracle table.i tried to be as simple as possible.
thanks
Step # 1
Prapare a data file (excel sheet) that would be uploaded to oracle table.
"Save As" a excel sheet to ".csv" (comma seperated values) format.
Then save as to " .dat " file.
e.g datafile.bat
1,Category Wise Consumption Summary,Expected Receipts Report
2,Category Wise Receipts Summary,Forecast Detail Report
3,Current Stock List Category Wise,Forecast rule listing
4,Daily Production Report,Freight carrier listing
5,Daily Transactions Report,Inventory Value Report
Step # 2
Prapare a control file that define the data file to be loaded ,columns seperation value,name and type of the table columns to which data is to be loaded.The control file extension should be " .ctl " !
e.g i want to load the data into tasks table ,from the datafile.dat file and having controlfile.ctl control file.
SQL> desc tasks;
Name Null? Type
TASK_ID NOT NULL NUMBER(14)
TASK_NAME VARCHAR2(120)
TASK_CODE VARCHAR2(120)
: controlfile.ctl
LOAD DATA
INFILE 'e:\datafile.dat'
INTO TABLE tasks
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(TASK_ID INTEGER EXTERNAL,
TASK_NAME CHAR,
TASK_CODE CHAR)
The above is the structure for a control file.
Step # 3
the final step is to give the sqlldr command to execute the process.
sqlldr userid=scott/tiger@abc control=e:\controlfile.ctl log=e:\logfile.log
Message was edited by:
user578762 -
I can not import the mvdemo.dmp into oracle database
I have download mapviewer from oracle ,but i can not import the demo data of mvdemo.dmp into oracle database ,it just report the character set problem can not transfer. i am using oracle 9i resease Chinese edition,may smoe friend tell me the how to solve problem. thanks a lot.and which character character set of mvdemo.dmp has used.
Drag the photos to the iPhoto icon on the dock. Then wait for the fix that will hopefully come in 10.8.3
-
Very urgent help needed- Error while passing XML document to Oracle stored
Hi !
I have been struggling a lot to call Oracle 9i stored procedure passing Stringbuilder object type from ASP.NET
I am using Visual Studio 2008 Professional, OS: Windows XP and Oracle: 9.2.0.1.0
Following is the procedure:
CREATE or REPLACE PROCEDURE loadCompanyInfo (clobxml IN clob) IS
-- Declare a CLOB variable
ciXML clob;
BEGIN
-- Store the Purchase Order XML in the CLOB variable
ciXML := clobxml;
-- Insert the Purchase Order XML into an XMLType column
INSERT INTO companyinfotbl (companyinfo) VALUES (XMLTYPE(ciXML));
commit;
--Handle the exceptions
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20101, 'Exception occurred in loadCompanyInfo procedure :'||SQLERRM);
END loadCompanyInfo ;
And following is the ASP.net code:
StringBuilder b = new StringBuilder();
b.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
b.Append("<item>");
b.Append("<price>500</price>");
b.Append("<description>some item</description>");
b.Append("<quantity>5</quantity>");
b.Append("</item>");
//Here you'll have the Xml as a string
string myXmlString1 = b.ToString();
//string result;
using (OracleConnection objConn = new OracleConnection("Data Source=testdb; User ID=testuser; Password=pwd1"))
OracleCommand objCmd = new OracleCommand();
objCmd.Connection = objConn;
objCmd.CommandText = "loadCompanyInfo";
objCmd.CommandType = CommandType.StoredProcedure;
//OracleParameter pmyXmlString1 = new OracleParameter("pmyXmlString1", new OracleString(myXmlString1));
objCmd.Parameters.Add("myXmlString1", OracleType.clob);
objCmd.Parameters.Add(myXmlString1).Direction = ParameterDirection.Input;
//objCmd.Parameters.Add("result", OracleType.VarChar).Direction = ParameterDirection.Output;
try
objConn.Open();
objCmd.ExecuteNonQuery();
catch (Exception ex)
Label1.Text = "Exception: {0}" + ex.ToString();
objConn.Close();
When I am trying to execute it, I am getting the following error:
Exception: {0}System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'LOADCOMPANYINFO' ORA-06550: line 1, column 7: PL/SQL: Statement ignored at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals) at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor) at System.Data.OracleClient.OracleCommand.ExecuteNonQuery() at Default.Button1Click(Object sender, EventArgs e)
I understand from this that the .net type is not the correct one, but I am not sure how to correct it. I could not find any proper example in any documentation that I came across. Most of the examples give information on how to read but not how to insert XML into Oracle table by calling Stored Procedure.
Can you please help me to solve this problem? I hope that you can help solve this.
Also, can you please give me an example of passing XML document XMLdocument to Oracle Stored procedure.
In both the cases, if you can provide the working code then it would be of great help.
Thanks,Hi ,
Additional to the Above error details my BPEL code looks like this:
<process name="BPELProcess1"
targetNamespace="http://xmlns.oracle.com/Application10/Project10/BPELProcess1"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:client="http://xmlns.oracle.com/Application10/Project10/BPELProcess1"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
<partnerLinks>
<partnerLink name="bpelprocess1_client" partnerLinkType="client:BPELProcess1" myRole="BPELProcess1Provider" partnerRole="BPELProcess1Requester"/>
</partnerLinks>
<variables>
<variable name="inputVariable" messageType="client:BPELProcess1RequestMessage"/>
<variable name="outputVariable" messageType="client:BPELProcess1ResponseMessage"/>
</variables>
<sequence name="main">
<receive name="receiveInput" partnerLink="bpelprocess1_client" portType="client:BPELProcess1" operation="process" variable="inputVariable" createInstance="yes"/>
<invoke name="callbackClient" partnerLink="bpelprocess1_client" portType="client:BPELProcess1Callback" operation="processResponse" inputVariable="outputVariable"/>
</sequence>
</process>
Kindly help if anyone has faced this Issue before.
Regards,
Rakshitha -
Upload a file into Oracle database without using a temp file in the server.
Hello.
I need to upload a file into a Oracle database, but I have not permission to write a temp file in the aplication server. Because of this, I can't use a MultipartRequest object.
Does anybody know how to do this?
Thanks everybody for your help.You can still use a MultiPart request.
Use the Apache FileUpload package.
Get the InputStream of the file being uploaded.
Now you can either store the file in memory by writing to a java.io.ByteArrayOutputStream or you can save the file to Oracle by writing it to a java.sql.Blob object using the Blob.setBinaryStream method. This Blob object can then be persisted to Oracle.
Unfortunately I don't have sample code readily available.
Maybe you are looking for
-
HP Color LaserJet 2605n main circuit
Hello. I recently bought an HP Color LaserJet 2605nd and was very satisfied for a short time. Then it failed. A repair company diagnosed main circuit board failure and that no replacement is possible. I am convinced that there will be secondhand sour
-
Ps assembly processing:WBS have not be created when saving the sales order
In the ps assembly processing, I want to generate a network when I create a sales order. So I did the following steps: 1-Use the TCODE cj91 to create a standard WBS "E-000007.1". 2-Use the TCODE cn01 to create a standard network "10000000" and assig
-
"I am facing this problem of SocketException being thrown on server console a number of times. I have just moved to weblogic 6.1 from 6.0. I have compiled all the classes with references to weblogic.jar and jdk from WL6.1. The cause of this exception
-
Problem with itunes downloading ios 3.1.1 for my ipod touch!
I have purchased ios 3.1.1 for my 1st gen ipod touch but cannot get it loaded onto my itunes. I have the latest version on my computer and no problems with internet connection so I'm at a loss as to what to do?? The error message coming up says:" an
-
Windows OS for Photoshop CS6 Extended?
I purchased Adobe Photoshop CS6 Extended, Student and Teacher version then noticed is requires Windows XP or WIndows 7 (with service pack). I am still running Windows Vista--can I use the software with VIsta?