Win a copy of Spring Boot in Practice this week in the Spring forum!

anilellendula kumar

Ranch Hand
+ Follow
since Jul 12, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by anilellendula kumar

I ahve list of txt filesin 'n directory
rolebased071607001038042.txt
crf-crf072307001037051.txt
crfonlyd073107001037060.txt

The above filenames contain the following (taking the first file as an example):
rolebased - This is the rolebasedinformation
071607 - This is the date (mmddyy)
001038042- This is the time including milliseconds(00:10:38:042 AM)


I need to sort these files descendingly according to date and then time (process the oldest files first, and the newest files last).
15 years ago
i need to connect to databse through the OCI Drivers ,My Database is Oracle 9i, so i have done below code




try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
//oracle.jdbc.pool.OracleConnectionPoolDataSource");
Connection conn=DriverManager.getConnection("jdbc:oracle:oci:@framid04.de.eu.colt:1522:WMTEST","projdef","projdef");
String sql="insert into CLOB_TEST(ID,DOCUMENT,XML_DOCUMENT) values (?,?,?)";
PreparedStatement pst=conn.prepareStatement(sql);

//pst.setLong(1, id);
pst.setInt(1,ordernum);
pst.setString(2,orderitm);
pst.setCharacterStream(3, reader1, data.length());

pst.executeUpdate();

if i am trying to run code with sample data Giving Exception

java.lang.reflect.InvocationTargetException:envCharSetId,pls check oracle.jdbc.driver.OracleDriver Driver supports OCI Driver if not supports can provide me the logic to insert CLOB Data.

in the above code if remove oci keep thin it is inserting below 4 kb data in CLOB OBJECT of DB Table.
My client requirement is to convert it to CLOB from string data and store in DB Table,can provide me logic to create CLOB object
here i tried with below code

long l=0;
oracle.sql.CLOB clobdocument=null;

try
{
Writer wr=clobdocument.setCharacterStream(l);
BufferedWriter br = new BufferedWriter(wr);
StringReader strrd=new StringReader(data);
char aux;
do{
aux=(char)strrd.read();
br.write(aux);
}while(aux != -1);


Giving Error

java.lang.reflect.InvocationTargetException: oracle.sql.CLOB.setCharacterStream(J)Ljava/io/Writer;


can anybobdy help how to Rectify this Problem,if my approach is wrong help me how convert String to Clob Object
Hai!


i am getting xml data as a string contain morethan 4kb size i am using thin driver oracle 9i database pls provide java programme to convert String to the java.sql.clob (not oracle.sql.clob)object to insert data in DB Table
Hai!


i am getting xml data as a string contain morethan 4kb size i am using thin driver oracle 9i database pls provide java programme to convert String to the java.sql.clob (not oracle.sql.clob)object to insert data in DB Table
How Can I Upload a Client File to a Server Folder Using jsp

here i have written below code in one jsp

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ReadFile</title>
</head>
<body>
<form name="index" action="ReadFromXls.jsp" method="Get" >
<br><FONT SIZE=2 FACE="Arial">Enter The Pathe Of The Xls File:     </font>    <td bgcolor="eb922c" align="center" width="10%" class="whitelnk"><input type="file" name="path" value=""></td></br>
<tr> <input type="submit" name="Submit" value="Upload" /></tr>
</form>

</body>
</html>


After Click On upload button it has to call ReadFormXls.jsp in this jsp i need to write code to store file in server.


How to upload a file from client machine file in to server folder.pls help on this


16 years ago
JSP
Hai!

Pls Help me on how to upload a file to the server using jsp


here one jsp ask u to browse the file after browsing user will submit, So After Click on Submit Button that jsp file has to upload in to the server, can any one help on this to upload a file to the server using jsp.
16 years ago
JSP
col table_name heading "Table|Name"
col column_name heading "Column|Name" format a25
select table_name,column_name from all_tab_columns
where rownum<11;

this sql and sqlplus command kept in TextFile, i want to call this textfile using java and connect to the database using JDBC can u help me the code of the JDBC to get the result of sql and sqlplus commands textfile
--------------------------------------------------------------------------------
Hai!

col table_name heading "Table|Name"
col column_name heading "Column|Name" format a25
select table_name,column_name from all_tab_columns
where rownum<11;

this sql and sqlplus command kept in TextFile, i want to call this textfile using java and connect to the database using JDBC can u help me the code of the JDBC to get the result of sql and sqlplus commands textfile
Hi,



Example
1)col table_name heading "Table|Name"
col column_name heading "Column|Name" format a25
select table_name,column_name from all_tab_columns
where rownum<11;

Example
2)column count format 99999999 heading "No. of|Rows"
select count(*) "count" from user_tables;



above two statements are having sqlplus command and sql command , These sqlplus and sql command i will pass through the TextArea to the Next Page , Next Page Having JDBC program it has to give result of these command ,How to code using java .
Hi All,

Does any one help me on how to Define methods in Serializable interface and how can i use that methods in a class, plz explain me with one example of writing state of an object in the file.
17 years ago
Hai!

Wat is singletone pattern, can anybody help me with an one example,how to make class as a singletone
17 years ago
if it doesnot have abstratct methods, how it has become interface, as per basic java , interface is nothing but it has abstract methods, where u implement an interface , we need to derive the all methods of the an interface, But in marker interface it is NOT happening , why it is called as an interface




17 years ago
wat clarification on marker interface? i knew that marker interface is the an interface it doesnot have any methods, if it doesnot have any methods wat is the use of implementing this methods? as per basic java fundamentals , an interface is nothing but it has all abstract methods where u implementing an interface we need derive the methods?but wat about the case in marker interfce


Ex: serilizable interface...
17 years ago