Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

Moving Java Applet from Sun Environment to Windows..

Thread view: 
crab.dae@gmail.com - 17 Aug 2007 16:47 GMT
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!
Andrew Thompson - 17 Aug 2007 17:19 GMT
>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?

Signature

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

Eric Sosman - 17 Aug 2007 20:48 GMT
Andrew Thompson wrote On 08/17/07 12:20,:

>>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.

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

Signature

Eric.Sosman@sun.com

Andrew Thompson - 18 Aug 2007 02:11 GMT
>Andrew Thompson wrote On 08/17/07 12:20,:
>
[quoted text clipped - 8 lines]
>portable Java?  Or did you read "not platform dependent"
>too hastily?

Oops.  I *read* wrong.

Sorry for any confusion that might have caused.

Signature

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

Manish Pandit - 17 Aug 2007 18:45 GMT
On Aug 17, 8:47 am, crab....@gmail.com wrote:
> 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
[quoted text clipped - 8 lines]
>
> 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
Roedy Green - 17 Aug 2007 21:13 GMT
>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.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Greg R. Broderick - 17 Aug 2007 23:01 GMT
crab.dae@gmail.com wrote in news:1187365641.125834.277490@
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!

Signature

---------------------------------------------------------------------
Greg R. Broderick                  usenet200707@blackholio.dyndns.org

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

crab.dae@gmail.com - 20 Aug 2007 20:52 GMT
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:oracle:thin:@" + 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:odbc: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!!
Manish Pandit - 20 Aug 2007 21:19 GMT
> Folks,
>
[quoted text clipped - 88 lines]
>
> 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
crab.dae@gmail.com - 22 Aug 2007 16:50 GMT
> > Folks,
>
[quoted text clipped - 110 lines]
> -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.
Andrew Thompson - 22 Aug 2007 17:06 GMT
...
>[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>

Signature

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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.