raghavender rao

Ranch Hand
+ Follow
since Jul 20, 2001
Merit badge: grant badges
For More
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 raghavender rao

hi ther,
i think Connection object is null...
try
System.out.println(con);
hi ther,
How can I insert special characters (for example: " , ', % )
when I execute an INSERT statement?
i am working onto customise my database, the solution should be through jdbc coz
in oracle u cant insert '
and in sql server "
is ther anyway to insert these chars without writing separate code for oracle,sql database etc,...
hi ther,
does anybody know any Mail Server which has SMTP,POP3,IMAP,LDAP and external database compatible with Oracle,SQL server...and JavaMail API...
22 years ago
no exception no error....
for ex:

first time:
public void disp(){
out.println("Hello...");
}
when u compile this and run this on browser it displays

" Hello... "
and when u make some changes like
public void disp(){
out.println("Hello...");
out.println("Bye...");
}
and when u compile this and run, the output is same
" Hello... "
wht cd be the problem....
22 years ago
hi ther,,
i do agree but it dosent supports IMAP and has some bugs and more over see the performance...and they are planning to change the architecture of JAMES...
hi ther,,,
we have created an email engine using tools like
Java 1.3,Java Mail,Oracle Application Server,Imail 7.0 and Oracle Database etc..
we have successful configured Imail server with our code using Imail Database.
but we are unable to configure it with External Database and the
database is Oracle 8 or 8i(tried with both)
(if possible) I would like to know the complete procedure as how do we configure Imail Server with
Oracle Database and it should run on Oracle Application Server.
Do i need to make any changes in jserv.properties file or any other changes...
(OR) Suggest any Mail Server which supports IMAP,POP3,LDAP,SMTP,
External Database compatible with Java Mail...

Please do Help me as soon as possible.
i think Mr Thomas Paul can help me.
Url to obtain evaluation copy of Imail Server is
http://www.ipswitch.com/products/IMail_Server/index.html
Please Help Me...

22 years ago
hi ther,,,
we have created an email engine using tools like
Java 1.3,Java Mail,Oracle Application Server,Imail 7.0 and Oracle Database etc..
we have successful configured Imail server with our code using Imail Database.
but we are unable to configure it with External Database and the
database is Oracle 8 or 8i(tried with both)
I would like to know the complete procedure as how do we configure Imail Server with
Oracle Database and it should run on Oracle Application Server.
Do i need to make any changes in jserv.properties file or any other changes...(or) Suggest any Mail Server which supports IMAP,POP3,LDAP,SMTP,External Database compatible with Java Mail...

Please do Help me as soon as possible.
i think Mr Mathew Kuruvilla can help me.
Url to obtain evaluation copy of Imail Server is
http://www.ipswitch.com/products/IMail_Server/index.html
just download JavaMail Api etc
and open ur inbox with setting the external database option on.
Please Help Me...
22 years ago
I am facing lot of problems with Oracle Application Server when i make any changes in .java file and compile. Class Files are not getting updated and each and every time i have to re-start the server, i donno wht is the problem and many times getting Internal Server Error and to overcome this have to Restart the system...Fed up with the problems
kindly solve this problem.......
22 years ago
hi all,
i have traced the bug and solved..
this is from JAMES.conf.xml properties file
<conn>file:///var/maildatabase</conn>;
<table>JAMESUSERS</table>
the problem was with case the table name should be
all upper case as JAMESUSERS not jamesusers
I have searched many sites and i cd nt find the answer but many have raised this question .
Hope this wd help many people...
22 years ago
hi ther,
i have successfully eshtablished database connection with RDBMS(Oracle). But when i try to adduser or listusers it says....
-------------------------------------
com.workingdogs.town.DataSetException: Error retrieving primary keys from table
jamesusers: Unable to retrieve primary keys on table jamesusers
at com.workingdogs.town.ConnDefinition.getSchema(ConnDefinition.java:227
)
at com.workingdogs.town.TableDataSet.<init>(TableDataSet.java:299)
at com.workingdogs.town.TableDataSet.<init>(TableDataSet.java:280)
at org.apache.james.userrepository.UsersTownRepository.countUsers(UsersT
ownRepository.java:171)
at org.apache.james.remotemanager.RemoteManager.parseCommand(RemoteManag
er.java:195)
at org.apache.james.remotemanager.RemoteManager.parseRequest(RemoteManag
er.java:117)
at org.apache.avalon.blocks.serversocket.ServerSocketAcceptor.run(Server
SocketAcceptor.java:77)
at org.apache.avalon.utils.recycle.pool.Worker.run(Worker.java:113)
-----------------------------------
i am sure it does have primary keys..but still the error wht could be the cause of the error please help me to solve this problem as soon as possible...
22 years ago
hi ther,,,
hope this code wil help u
import java.sql.*;
import java.io.*;
import oracle.jdbc.driver.OracleDriver;

class DemoDataBaseTest {

public static void main(String args[]){

Connection con = null;
PreparedStatement pstmt;
ResultSet rs;
Blob blob = null;

try{


DriverManager.registerDriver(new OracleDriver());
con = DriverManager.getConnection("jdbc racle:thin:@192.168.0.50:1521:ORCL","scott","tiger");

Statement stmt = con.createStatement();
pstmt = con.prepareStatement("insert into temp values(?,?)");

pstmt.setInt(1,1);

File file = new File("apache_pb.gif");

//File file = new File("Part.java");

pstmt.setBinaryStream(2,new FileInputStream(file),(int)file.length());


int i = pstmt.executeUpdate();

System.out.println( "the execution succeeds");

String strqry = "select * from temp";

rs = stmt.executeQuery(strqry);


if(rs.next()){

i = rs.getInt(1);
blob = rs.getBlob(2);

System.out.println("Values Retreived Successfully");

} else {

System.out.println("Cannot Retreive Values from database");

}

InputStream is = blob.getBinaryStream();


FileOutputStream fos = new FileOutputStream("apache_pb2.gif");

int c=0;

while((c = is.read()) != -1){


fos.write(c);

}



}catch(Exception e){


System.out.println("Oops");
e.printStackTrace();


}



}


}

using the above program u can store/retreive any type of file... any database....
Rao


------------------
Rao
Sun Certified Programmer for the Java� 2 Platform
22 years ago
hi ther,,,

i wd suggest tht u go through this website...hope this wil help u...
- A Java FTP client library for embedding FTP functionality in programs.
http://www.gnu.org/software/java/java-software.html

Rao
22 years ago
hi ther,

i want to call Testservlet2 in Testservlet1 using URL Class...
like
URL url = new URL("/servlet/TestServlet2");
(without using res.sendRedirect())
i kn tht i can make use of URL class and AppletContext in Applets to showDocuments ....but i want to kn how do we make use of URL class in servlets to call another servlet....

Rao
22 years ago
hi ther ,,,

usually u get this problem when the maximum number of processes have been extended....i mean to say abt the Database.....
Rao
22 years ago
hi ther...

hope this code wil help u....

this is for creating jar file
import java.io.*;
import java.util.*;
import java.util.jar.*;
public class JarCreate {

public static void main(String[] args) throws IOException {

// Create the jar file, using the first command line argument as the
// file name (clobbering the file if it exists).
String jarName = args[0];
JarOutputStream jar = new JarOutputStream(new FileOutputStream(jarName), new Manifest());

System.out.println(jarName + " created.");
try {

// Allocate a buffer for reading the input files.
byte[] buffer = new byte[1024];
int bytesRead;
// Loop through the file names provided on the command-line.
for (int i = 1; i < args.length; i ++) {

// Get the file name.
String fileName = args[i];

try {
// Open the file.

FileInputStream file = new FileInputStream(fileName);
try {

// Create a jar entry and add it to the jar.

JarEntry entry = new JarEntry(fileName);
jar.putNextEntry(entry);
// Read the file the file and write it to the jar.
while ((bytesRead = file.read(buffer)) != -1) {

jar.write(buffer, 0, bytesRead);

}
System.out.println(entry.getName() + " added.");
} catch (Exception ex) {


System.out.println(ex);
}

finally {

file.close();

}

} catch (IOException ex) {

System.out.println(ex);
}
}
} finally {

jar.close();
System.out.println(jarName + " closed.");
}
}
}

this is for extracting jar files
import java.io.*;
import java.util.*;
import java.util.jar.*;
public class JarExtract {

public static void main(String[] args) throws IOException {

// Get the jar name and the entry name.
String jarName = args[0];
String entryName = args[1];
// Open the jar.
JarFile jar = new JarFile(jarName);
System.out.println(jarName + " opened.");
try {
// Get the entry and its input stream.
JarEntry entry = jar.getJarEntry(entryName);
// If the entry is not null, extract it. Otherwise, print a
// message.
if (entry != null) {

// Get an input stream for the entry.

InputStream entryStream = jar.getInputStream(entry);
try {
// Create the output file (clobbering the file if it exists).
FileOutputStream file = new FileOutputStream(entry.getName());
try {

// Allocate a buffer for reading the entry data.
byte[] buffer = new byte[1024];
int bytesRead;
// Read the entry data and write it to the output file.

while ((bytesRead = entryStream.read(buffer)) != -1) {

file.write(buffer, 0, bytesRead);
}
System.out.println(entry.getName() + " extracted.");
} finally {

file.close();
}
} finally {

entryStream.close();
}
} else {

System.out.println(entryName + " not found.");
} // end if
} finally {

jar.close();
System.out.println(jarName + " closed.");
}
}
}

any doubts dont hesitate to mail me back

Rao
22 years ago