Hi,

2 ways for now....

Use JDBC but get the driver first for your  database...put it in your
project folder...then write the code(google that..plenty of items  are
there).

Another way is to use Hibernate (if your project is Hibernate )...

Thanks,
jd

On 8/27/10, Nguyễn Đình Đoàn <nguyendinhd...@gmail.com> wrote:
> Hi friends,
>
> I developed an application in .NET, I needn't open SQL Server Management
> Studio and then add my .mdf file!
> I need create a string connection only and then execute. This is my
> connect() method I used for my project in VB.net:
>
> // I use express edition
>
> Public Shared Sub connect()
>         strSqlConn = "Data
> Source=.\sqlexpress;AttachDbFileName=C:\MayAnh.mdf;Integrated Security=true;
> Connect Timeout=30;User Instance=True"
>         conn = New SqlConnection
>         conn.ConnectionString = strSqlConn
>         conn.Open() 'mở kết nối
> End Sub
>
> In Java, I must open sql server configuration Manager and find the port,
> open ide then add database....
> So, I want to ask, I have .mdf file and how to connect to database like the
> code above but in Java ?
> Thanks !
>
> --
> You received this message because you are subscribed to the Google
> Groups "Java EE (J2EE) Programming with Passion!" group.
> To post to this group, send email to
> java-ee-j2ee-programming-with-passion@googlegroups.com
> To unsubscribe from this group, send email to
> java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to