Moving Java Applet from Sun Environment to Windows..

C

crab.dae

I've got a Java web application that's sitting on a Sun box hitting a
Oracle DB that must be moved to a Windows environment. Because I know
nothing about Java, other then hearing it's not platform dependent, I
need some assistance on what steps need to be done to move such
application.

I know I need to point the calls for the database to MS SQL from
Oracle, but is there anything else I need to do? Do I just uncompress
the existing JAR/Class files, make the connection changes,
recompress? Could it be that simple?

Thanks!
 
A

Andrew Thompson

I've got a Java web application that's sitting on a Sun box hitting a
Oracle DB that must be moved to a Windows environment. Because I know
nothing about Java, other then hearing it's not platform dependent,

You heard wrong. Unless it was coded by crappy
programmers, or delves into JNI or such.
...need some assistance on what steps need to be done to move such
application.

What's your budget and/or time-frame?

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200708/1
 
M

Manish Pandit

I've got a Java web application that's sitting on a Sun box hitting a
Oracle DB that must be moved to a Windows environment. Because I know
nothing about Java, other then hearing it's not platform dependent, I
need some assistance on what steps need to be done to move such
application.

I know I need to point the calls for the database to MS SQL from
Oracle, but is there anything else I need to do? Do I just uncompress
the existing JAR/Class files, make the connection changes,
recompress? Could it be that simple?

Thanks!
From a java standpoint, you should be okay. Like Andrew said, unless
its coded by crappy programmers or has JNI/Runtime.exec() stuff, it
should be 100% portable.

The MS-SQL to Oracle piece should be easy, but there are certain
gotchas. If the app uses MQ-SQL specific constructs and queries then
you might have to refactor all that (for example, if it uses "select
top <n> from <table>" - this wont fly in oracle). This also depends on
the design of the app, if the SQLs, Database connection strings,
drivers, etc. are hardcoded all over the code then it'd be all the
more time consuming. I'd say the first steps would be to migrate the
data, and change the driver and the connection string to oracle. If it
has JUnits, and the Junits have a good code coverage, then give them a
run, followed by a full cycle of functional testing. If you run into
SQL Exceptions, that could be due to SQL incompatibilities like the
one I mentioned above.

Also it sounds like you do not have the source code for the app - in
that case, hope that the SQLs are portable and you do not have to
modify a java class to change the driver/connection stuff :)

-cheers,
Manish
 
E

Eric Sosman

Andrew Thompson wrote On 08/17/07 12:20,:
You heard wrong. Unless it was coded by crappy
programmers, or delves into JNI or such.

Are you saying that only crappy programmers write
portable Java? Or did you read "not platform dependent"
too hastily?
 
R

Roedy Green

I've got a Java web application that's sitting on a Sun box hitting a
Oracle DB that must be moved to a Windows environment. Because I know
nothing about Java, other then hearing it's not platform dependent, I
need some assistance on what steps need to be done to move such
application.

It depends how it is written. Most typically the app would come in two
parts, the server part and the client part. The Applet client part
would need no changes at all. It is naturally mulitplatform. It has to
keep people happy with many different browsers.

The server part in theory could run unchanged, but if you change the
SQL engine or the Servlet Womb, you may need to make some changes
since these are not 100% standard. At the least you need to change
the connect code.

If the Applet uses JDBC directly to access the database, usually
considered a security risk, you must repackage a different JDBC driver
with your jar. If the driver is written in Java, you can use the same
driver for everyone. If it is a native driver, you get into the
nightmare of requiring a different driver for every platform. Unlike
Java Web Start, Applets don't automatically select the correct native
code.
See http://mindprod.com/jgloss/jdbc.html
to learn about the four types of driver.
 
G

Greg R. Broderick

(e-mail address removed) wrote in 57g2000hsv.googlegroups.com:
I've got a Java web application that's sitting on a Sun box hitting a
Oracle DB that must be moved to a Windows environment.
....

I know I need to point the calls for the database to MS SQL from
Oracle

Why? Can't you keep hitting the oracle database from your Windows app
server? Can't you install Oracle on your Windows servers?

IMO, if the SQL isn't specifically written to be portable and to not use
any Oracle-specific features, then the porting of the Oracle-specific SQL
embedded in this application will be the toughest part of the move.

Cheers!

--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 
C

crab.dae

Folks,

I'm not worried about the SQL queries themselves because I can fix
those. My biggest issue is changing the connection string to connect
to MS SQL, instead of Oracle.

I just started a new thread from what's the the original JAVA file,
but here's a copy below in case anyone can help.

==================================

Need some help.....

Below is what I currently have that's written in JAVA to connect to
Oracle, but I need to change it to connect to MS SQL.

===========

private void dbInit()
{
dbUrl = "jdbc:eek:racle:thin:mad:" + paramServerIP + ":3500:" +
paramDbSID;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(Exception eDriver)
{
failedDialog("Driver failed!", eDriver.getMessage());
}
}

private void dbOpen()
{
if(paramServerIP.indexOf("datadev") >= 0)
dbPswd = "test_pass";
else
dbPswd = "web_pass";
try
{
dbCon = DriverManager.getConnection(dbUrl, paramDbUserStr,
dbPswd);
dbStmt = dbCon.createStatement();
dbStmt.setEscapeProcessing(true);
}
catch(Exception eDbOpen)
{
failedDialog("Failed to open db connection!",
eDbOpen.getMessage());
}
}

private void dbClose()
{
try
{
dbStmt.close();
dbCon.close();
}
catch(Exception eDbClose)
{
failedDialog("Failed to close db connection!",
eDbClose.getMessage());
}
}
=========

Can someone tell what what I need to change? I need to change it to
connect a Database named datadev on a MS SQL 2000 server. Where do I
put the below info?

"jdbc:eek:dbc:DRIVER={SQL
Server};Database="DATADEV";Server=VS032.INTERNAL.COM:3553;",
"web_user", "password"

Here's info that might be more clear then the above:

Server: VS032.INTERNAL.COM
Port: 3553
Database: DATADEV
User ID: web_user
Password: password

Sorry to ask, but I'm not a JAVA developer and was tasked to move a
web page from a UNIX platform to a Windows setup.

===========================

It's probably something simple that most of you could do with your
eyes closed, but for me, Java is learning Chinese.

Thanks!!
 
M

Manish Pandit

Folks,

I'm not worried about the SQL queries themselves because I can fix
those. My biggest issue is changing the connection string to connect
to MS SQL, instead of Oracle.

I just started a new thread from what's the the original JAVA file,
but here's a copy below in case anyone can help.

==================================

Need some help.....

Below is what I currently have that's written in JAVA to connect to
Oracle, but I need to change it to connect to MS SQL.

===========

private void dbInit()
{
dbUrl = "jdbc:eek:racle:thin:mad:" + paramServerIP + ":3500:" +
paramDbSID;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(Exception eDriver)
{
failedDialog("Driver failed!", eDriver.getMessage());
}
}

private void dbOpen()
{
if(paramServerIP.indexOf("datadev") >= 0)
dbPswd = "test_pass";
else
dbPswd = "web_pass";
try
{
dbCon = DriverManager.getConnection(dbUrl, paramDbUserStr,
dbPswd);
dbStmt = dbCon.createStatement();
dbStmt.setEscapeProcessing(true);
}
catch(Exception eDbOpen)
{
failedDialog("Failed to open db connection!",
eDbOpen.getMessage());
}
}

private void dbClose()
{
try
{
dbStmt.close();
dbCon.close();
}
catch(Exception eDbClose)
{
failedDialog("Failed to close db connection!",
eDbClose.getMessage());
}
}
=========

Can someone tell what what I need to change? I need to change it to
connect a Database named datadev on a MS SQL 2000 server. Where do I
put the below info?

"jdbc:eek:dbc:DRIVER={SQL
Server};Database="DATADEV";Server=VS032.INTERNAL.COM:3553;",
"web_user", "password"

Here's info that might be more clear then the above:

Server: VS032.INTERNAL.COM
Port: 3553
Database: DATADEV
User ID: web_user
Password: password

Sorry to ask, but I'm not a JAVA developer and was tasked to move a
web page from a UNIX platform to a Windows setup.

===========================

It's probably something simple that most of you could do with your
eyes closed, but for me, Java is learning Chinese.

Thanks!!

Best option would be to pull these settings out of your code, and put
them either in properties file, or have your main class read it as
system properties (via -Dname=value).

You'd need a Connection URL, UserID, password and the jdbc driver
class name for any JDBC connection to any db, so people normally
externalize these.

Then, you will need to download MS-SQL pure JDBC driver, or you can
use the JDBC-ODBC bridge (I would not recommend it though). For the
pure JDBC driver, either you can use the one from Microsoft, or an
open source one from JTDS. (http://jtds.sourceforge.net/).

In case of jTDS, the driver class name would be
"net.sourceforge.jtds.jdbc.Driver" and connection URL will be
jdbc:jtds:sqlserver://vs032.internal.com:3553/DATADEV.

Refer to jTDS site on FAQ and documentation.

-cheers,
Manish
 
C

crab.dae

Best option would be to pull these settings out of your code, and put
them either in properties file, or have your main class read it as
system properties (via -Dname=value).

You'd need a Connection URL, UserID, password and the jdbc driver
class name for any JDBC connection to any db, so people normally
externalize these.

Then, you will need to download MS-SQL pure JDBC driver, or you can
use the JDBC-ODBC bridge (I would not recommend it though). For the
pure JDBC driver, either you can use the one from Microsoft, or an
open source one from JTDS. (http://jtds.sourceforge.net/).

In case of jTDS, the driver class name would be
"net.sourceforge.jtds.jdbc.Driver" and connection URL will be
jdbc:jtds:sqlserver://vs032.internal.com:3553/DATADEV.

Refer to jTDS site on FAQ and documentation.

-cheers,
Manish

Is there an example I can drop on the web server to test that the JDBC
driver is installed? The server admin tells me it's not installed but
pointed me to links on the web about making a connection to sql that
all seem to use JBDC.

Thanks.
 
A

Andrew Thompson

[quoted text clipped - 110 lines]

To both you folks. *Please* trim text not immediately
relevant to your replies. The way you are replying at
the moment is called 'bottom-posting', and it is almost
as illogical and inconvenient as top-posting.

'In-line posting with trim' is the best way to communicate
an idea, without using excessive bandwidth.
<http://www.physci.org/codes/javafaq.html#toppost>

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200708/1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top