Discount Web Design Blog

Just another Web Design Blog

Entries for the ‘Java and JSP’ Category

webdav add attachment

hi,
im using webdav, httpclient api, to send email to exchange 2007
with the following code i send a message successfully:

Code:
String strTempRelativeURI="https://webmail/exchange/user@email.com/Drafts/";

PutMethod pm = new PutMethod ("https://webmail/exchange/user@email.com/Drafts/test5.eml/");
pm.setRequestBody(body);
client.executeMethod(pm);

move(strTempRelativeURI + "test5.EML", strSubRelativeURI, null);

public static void move(String urlOrigem, String urlDest, HttpConnection conn)
throws Exception
{

MoveMethod method = new MoveMethod(urlOrigem, urlDest,true);
try {
int rc = client.executeMethod(method);
System.out.println("Return Code: [...]

mySQL JDBC module problem!

Hi everyone?
I followed the link http://dev.mysql.com/downloads/ to connect jsp and mysql, I’m not sure which file to download and how to install it:MySQL Connector/J 3.1 or MySQL Connector/MXJ 5.0.
I’m running MySQL 5.0.18 with wamp.
Someone could tell me which module is appropriate?

Help with JDBC Insert code

Guys,
I have the code below. Not perfect I know but Im just messing about.
callLogger.java :

Code:

package helpdesk;

import java.util.*;

public class callLogger {

public void logCall(String firstName, String secondName, String telephoneNumber, String callDescription) {

callSaver save = new saveToMysql();
save.save(firstName, secondName, telephoneNumber, callDescription);

[...]

Syntax error in INSERT INTO statement

Hi folks,
Can anyone see what’s wrong in the Insert query statement? Categorylist is a listbox value (not dynamic). Publ is a checkbox value and the others are text boxes. I’m using JSP, trying to update the Access 2000 database from a form.

Code:
char publ;

String ename =(request.getParameter("eventname"));
String loc =(request.getParameter("locat"));
[...]

JDBC Connection does not connected

I am trying to connect with SQL Server 2005 using JDBC Driver for SQL Server 2005. But i am having the errors, i have put the jar(Driver) file into the lib folder.
I am using the following code for connection using java code.

Quote:

import java.*;
import java.sql.*;
public class sqlcon {
private java.sql.Connection [...]

Java, MySQL, Unix Database Connectivity using gnu_net_local

Hi All,
I’ve developed a site that is nearly complete with all the relevant bells and whistles Ajax etc
Anyway, The client is using MySQL on a Unix box whereas I had developed the site using MySQL and typical Connector/J com.mysql.jdbc.Driver
Below is the source code for my ConnectionManager object

Code:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Locale;
import java.util.ResourceBundle;

public class ConnectionManager {

[...]

Help needed to install tomcat in linux

Hi ..,

anybody please help me to install tomcat in red hat machine.. since i m involved in developing web application i m need of tomcat urgently can anybody please extend your help..
if start the tomcat i m getting below lines displayed in my terminal
Using CATALINA_BASE: /opt/linux softwares/apache-tomcat
Using CATALINA_HOME: /opt/linux softwares/apache-tomcat
Using CATALINA_TMPDIR: /opt/linux softwares/apache-tomcat/temp
Using JRE_HOME: /usr

but [...]

Help convert some code

Here is a fragment of javabean code:

Code:
more code above….
public ResultSet execSQL() throws SQLException{
String sql;
sql = "SELECT ownerid, oname, ostreet FROM powners ORDER BY oname";

try
{
PreparedStatement os = obCon.prepareStatement(sql);
ResultSet ownerr = os.executeQuery();

return (ownerr == null) ? null : ownerr;
// PreparedStatement s = null;

}
catch (SQLException se)
{
// log exception;
[...]

Open source webshop project

Hi there… I wrote web shop for computer parts in Java (JSP & Servlets + JSTL for templates)
App has MVC approach and it is full customizable. Also it is capable to create a complete computers through wizard where user can select all computer parts into one computer.
There is much more features but I want [...]

Sending SMS from JAVA

HI,
I need to send SMS to client from my application. For this i followed sending SMS from email by using below code.

import java.io.*;
import java.net.InetAddress;
import java.util.Properties;
import java.util.Date;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class SMTPSend {
public SMTPSend() {
}
public void msgsend() {
String username = "username";
String password [...]