![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2006
Posts: 7
Rep Power: 0
![]() |
Can this work
jus wandering if this code can work properly, im kinda learning java from friends and teaching myself
package transaction.processing; import java.sql.SQLException; import java.sql.Connection; import java.sql.DriverManager; public class MyConnection { private static Connection con; public MyConnection () { } public static Connection connect()throws SQLException,ClassNotFoundException { Class.forName(" sun.jdbc.odbc.JdbcOdbcDriver"); String filename = System.getProperty("user.dir")+"/ChecheComm.mdb"; String database ="jdbc:odbc river={Microsoft Access Driver (*.mdb)};DBQ=";database+= filename.trim()+";DriverID=22;READONLY=false}"; con=DriverManager.getConnection(database); return con; } } |
|
|
|
|
|
#2 | |
|
Professional Programmer
|
Why ask, why not just try it?
__________________
▄▄▄▄ Quote:
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it. Download Code::Blocks now! ▄▄▄▄ |
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2006
Posts: 7
Rep Power: 0
![]() |
at the time wen i came up with tha code, i was at a place without jcreator, textpad or any thing i can use to try run the code, so i decided to ask
|
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4
![]() |
I haven't taken a look at your code as it is not formatted properly. Use code tags to perserve indentation of code on these forums. You should also turn smilies off. Also take a look at How to post a question and Forum Rules.
__________________
PFO - My daily dose of technology. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|